AFTD Auto-Formalizing Theoretical Domains

MatrixMap.choi_matrix

defimported Lean

Choi matrix of a given linear matrix map. Note that this is defined even for things that aren't CPTP, it's just rarely talked about in those contexts. This is the inverse of MatrixMap.of_choi_matrix. Compare with MatrixMap.toMatrix, which gives the transfer matrix.

Statement

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
variable {A B C D E F R : Type*} [Fintype A] [DecidableEq A] in
variable [Semiring R] in
def MatrixMap.choi_matrix (M : MatrixMap A B R) : Matrix (B × A) (B × A) R
Defined in
QuantumInfo, `MatrixMap.choi_matrix`
Lean proof
By Alex Meiburg, from github.com/leanprover-community/physlib at e411c6e89692 (Copyright (c) 2025 Alex Meiburg. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.34.1.
Verified
16 Oct 2026
Axioms
none listed
Built on 1
  • MatrixMapA MatrixMap is a linear map between squares matrices of size A to size B, over R.
Used by 6

Lean source view module on GitHub

set_option autoImplicit true in
set_option relaxedAutoImplicit true in
variable {A B C D E F R : Type*} [Fintype A] [DecidableEq A] in
variable [Semiring R] in
/-- Choi matrix of a given linear matrix map. Note that this is defined even for things that aren't CPTP, it's just rarely talked about in those contexts. This is the inverse of `MatrixMap.of_choi_matrix`. Compare with `MatrixMap.toMatrix`, which gives the transfer matrix. -/
def MatrixMap.choi_matrix (M : MatrixMap A B R) : Matrix (B × A) (B × A) R :=
  fun (j₁,i₁) (j₂,i₂) ↦ M (Matrix.single i₁ i₂ 1) j₁ j₂
See it in the graphDiscuss this resultChallenge it