QuantumInfo.Finite.Braket
Finite dimensional quantum pure states, bra and kets. Mixed states are `MState` in that file.
These could be done with a Hilbert space of Fintype, which would look like ```lean4 (H : Type*) [NormedAddCommGroup H] [InnerProductSpace ℂ H] [CompleteSpace H] [FiniteDimensional ℂ H] ``` or by choosing a particular `Basis` and asserting it is `Fintype`. But frankly it seems easier to mostly focus on the basis-dependent notion of `Matrix`, which has the added benefit of an obvious "classical" interpretation (as the basis elements, or diagonal elements of a mixed state). In that sense, this quantum theory comes with the a particular classical theory always preferred.
49 declarations
Bra notation
The notation represents a linear functional, referred to as a "bra" vector, which is the dual of a state vector . In the context of finite-dimensional quantum mechanics, this operator maps elements of a Hilbert space to the complex numbers .
Ket notation for pure states
Let be a finite index set. For an element that can be interpreted as a vector in , the notation denotes the corresponding quantum state (ket) in the space of pure states `Ket d`. This notation acts as a coercion or constructor that treats a vector-like object as a ket in the specified finite-dimensional Hilbert space.
Function-like coercion for kets
Let be a finite index set. The type of kets `Ket d`, which represents pure quantum states as vectors in , is endowed with a `FunLike` instance. This allows a ket to be treated as a function from the index set to the complex numbers , where the value at an index is the -th component of the underlying vector .
Function Evaluation of Ket Equals its Vector Representation
For any quantum state vector (ket) in a finite-dimensional Hilbert space with basis , the evaluation of as a function from the basis to the complex numbers is equivalent to its underlying vector representation .
Function-like coercion for bras
Let be a finite index set. The type of bras `Bra d`, which represents the dual vectors (row vectors) in the finite-dimensional Hilbert space , is endowed with a `FunLike` instance. This allows a bra to be treated as a function mapping each index to a complex number . Specifically, for any bra , the value at index is defined by the -th component of its underlying vector representation . The mapping is injective, meaning two bras are equal if and only if their vector components are identical.
Function Evaluation of Bra Equals its Vector Representation
For any quantum state covector (bra) in a finite-dimensional Hilbert space with basis , the evaluation of as a function from the basis to the complex numbers is equivalent to its underlying vector representation .
The inner product of a bra and a ket
Given a finite index set , a bra and a ket are represented as vectors in . The dot product is defined as the sum over the index set of the product of their components: where and denote the -th components of the bra and ket respectively.
Braket notation for the inner product of a bra and a ket
Given a bra vector and a ket vector , the notation represents their inner product (or "bracket"), which is a complex number in . This is defined by applying the dot product function to the vectors and .
equals the dot product of and
Let be a finite index set. For a bra and a ket , the bracket (inner product) is equal to the standard dot product of their underlying vectors, denoted as .
Component-wise evaluation of kets
Let be a finite index set and be a ket in . For any index , the value of the ket when treated as a function at , denoted , is equal to the -th component of its underlying vector .
Components of Bra are equal to the components of its vector representation
Let be a finite index set and be a dual vector in the bra representation (an element of ). For any index , the value of the function applied to is equal to the component of its underlying vector at index . In other words, .
Extensionality of Kets ()
Let and be quantum states in the ket representation (elements of type `Ket d`). If for every index , the components of the states are equal, i.e., , then the states themselves are equal, .
Extensionality of dual vectors (bras) in
Let be a finite index set representing the dimension of the Hilbert space. For any dual vectors (bras) , if for all basis indices , the components are equal (i.e., ), then the dual vectors themselves are equal ().
The squared components of a ket sum to 1
For any quantum state represented as a ket in a finite-dimensional space indexed by , the sum of the squared norms of its components over all indices is equal to , i.e., .
Normalization Condition for Bras in
Let be a finite index set representing the dimensions of a Hilbert space, and let be a dual vector (bra). The sum over all basis indices of the squared norm of the components is equal to 1.
Mapping a ket to its conjugate bra
Given a finite index set , any ket (represented as a vector in ) can be mapped to its corresponding bra . This transformation is defined by taking the complex conjugate of each element of the vector: for all .
Conversion of a bra to a ket via conjugation
Given a bra vector in a -dimensional Hilbert space (represented as a function satisfying a normalization condition), the function `Bra.to_ket` maps it to its corresponding ket vector by taking the complex conjugate of each component, such that .
Coercion from to
An instance of the coercion operator from the space of ket vectors (represented as column vectors) to the space of bra vectors (represented as row vectors/linear functionals). This coercion is defined by the mapping `Ket.to_bra`, which corresponds to the conjugate transpose operation .
Coercion from to
An instance of the coercion operator from the space of bra vectors to the space of ket vectors , defined by the correspondence between a linear functional and its dual vector (specifically using the `Bra.to_ket` map).
Components of Bra are Complex Conjugates of Ket Components
Let be a ket vector in a finite-dimensional Hilbert space indexed by . For any index , the evaluation of the corresponding bra vector at is equal to the complex conjugate of the -th component of the ket's underlying vector, denoted as .
for any normalized ket
For any normalized ket in a finite-dimensional Hilbert space (represented as a vector in where is a finite index set), there exists at least one index such that the component is non-zero.
A Normalized Bra is Non-Zero at Some Index
Let be a normalized bra vector in a finite-dimensional Hilbert space (represented as a function from a finite index set to the complex numbers ). There exists at least one index such that the component is non-zero.
Normalization of a vector to a Ket
Given a finite set , a vector , and a proof that is not the zero vector (i.e., there exists some such that ), this function constructs a normalized ket . The components of the resulting vector are defined as: where the denominator is the -norm . The definition ensures the resulting vector has unit norm, .
Normalization of the vector of a ket equals
Let be a ket (a normalized vector in ). If we take the underlying vector and apply the normalization function `Ket.normalize` (using the fact that is non-zero), the resulting ket is equal to the original . Specifically, for any , , where is the proof that has at least one non-zero component.
Normalization of a vector to a Bra
Given a finite indexing set and a vector such that has at least one non-zero component (), the normalization function produces a bra (row vector) by scaling by the reciprocal of its -norm. Specifically, the resulting vector is defined by for each . This construction ensures that the resulting bra satisfies the normalization condition .
Normalizing the vector of a bra returns
For any normalized row vector (bra) in a -dimensional Hilbert space, normalizing its underlying vector results in the original bra itself. Here, is the raw vector representation of the bra, and the normalization process involves dividing the vector by its -norm.
Uniform superposition state
Given a finite indexing set that is non-empty, the uniform superposition state is defined as the normalization of a vector where every component is . Specifically, it is the Ket defined by the components: for all , where denotes the cardinality of the set . This state represents a coherent superposition of all basis elements with equal probability amplitudes.
Default Ket as the uniform superposition
For any non-empty finite index set , there exists a default instance of a "Ket" vector in the Hilbert space. This default ket is defined as the uniform superposition state: where is the cardinality of the set and are the computational basis vectors.
Computational basis vector
Given a finite type , the function constructs a "Ket" vector in the Hilbert space corresponding to a basis element . Representing the state as a function , it is defined as the Kronecker delta , which takes the value when and otherwise.
Computational basis vector
Given a finite index set , for any element , the function constructs the corresponding basis "Bra" vector . It is defined as a linear functional on the space of "Kets" (represented as functions ), such that when applied to a basis element , it yields if and otherwise.
Function-like interpretation of Bra
For a finite index set , any Bra vector in the dual space can be treated as a function mapping a Ket vector to a complex number . This mapping is defined by the inner product (or braket) . The implementation ensures that a Bra is uniquely determined by its action on all Ket vectors.
for any state
Let be a finite index set and be a ket in representing a normalized quantum pure state. The inner product of the state with itself, denoted by , is equal to .
Outer Product of two kets and
Given two kets and representing pure quantum states in finite-dimensional Hilbert spaces indexed by and respectively, their product is a ket in the tensor product space indexed by . The components of the resulting vector are defined by the product of the individual components, i.e., for all . This construction creates an unentangled (separable) state.
Tensor product notation for kets
This is a notation definition for the tensor product of two quantum ket states. For two kets of dimension and of dimension , the notation represents the combined state in the tensor product Hilbert space of dimension , computed via the `Ket.prod` function.
is a product state
A quantum state (ket) in the composite Hilbert space (representing the tensor product ) is a product state if there exist states and such that .
is an entangled state
A state vector (ket) in the tensor product space is said to be entangled if it cannot be expressed as a product state (i.e., it is not a decomposable tensor for some and ).
The tensor product of two kets is a product state.
Let and be two quantum states (kets) in Hilbert spaces of dimensions and , respectively. Then their tensor product (denoted `ψ₁.prod ψ₂`) is a product state.
A product of two kets is not entangled
For any two quantum states in a Hilbert space of dimension and in a Hilbert space of dimension , their tensor product state is not an entangled state.
is a product state
Let and be finite index sets, and let be a ket in the tensor product space . Then is a product state if and only if for all indices and , the components of the ket satisfy the cross-multiplicativity condition:
Maximally entangled state on
Let be a finite non-empty type. The maximally entangled state (MES) on the system is a state vector (ket) whose components are given by: where denotes the cardinality of . This state corresponds to a normalized superposition of basis states with all-positive phases. In the specific case where has size 2, this definition yields the standard Bell state .
The maximally entangled state is entangled for
Let be a type representing a finite-dimensional Hilbert space basis. If is nontrivial (meaning the dimension of the space is at least ), then the maximally entangled state `MES` in the tensor product space is entangled.
The Transpose Trick:
Let be a finite non-empty type representing the basis of a Hilbert space. For any matrix , the following identity holds when acting on the vector representation of the maximally entangled state : where is the identity matrix, denotes the Kronecker product (), denotes the transpose of , and is the maximally entangled state `Ket.MES d`.
Equivalence relation of kets up to a global phase
Let `Ket d` be the type of quantum state vectors (kets) in a system with basis . The relation `Ket.PhaseEquiv` is defined as a setoid (equivalence relation) on `Ket d`, where two kets and are equivalent if there exists a complex number such that and the state vectors satisfy . Mathematically, this captures the notion that two quantum states are equivalent if they differ only by a global phase.
Quantum pure states as kets up to a global phase
Let be a type representing the dimensions of a finite-dimensional Hilbert space. The type is defined as the quotient of the space of kets by the equivalence relation . This relation identifies two kets if they differ only by a global phase factor . This represents the space of pure quantum states, where physical observables are invariant under such phase transformations.
The canonical projection from a to a quantum state
Let be a ket in the space . The function maps the ket to its corresponding equivalence class in the quotient space . This quotient space represents pure quantum states where kets are identified if they differ only by a global phase factor .
Lifting a phase-invariant function from to
Let be the type of quantum state vectors (kets) and be the quotient space defined by the phase equivalence relation , where if there exists with such that . Given a function and a proof that is phase-invariant (i.e., ), the function `KetUpToPhase.lift` returns the induced function .
The lift of a phase-invariant function applied to the class equals
Let be the set of finite-dimensional quantum state vectors (kets). Let be the quotient of by the phase equivalence relation (where if they differ only by a complex phase). For any function that is invariant under phase changes (i.e., whenever ), let be the function induced by on the quotient space. Then for any ket , the value of applied to the equivalence class is equal to .
Induction Principle for Quantum States up to a Phase
Let be the space of quantum pure states, defined as the quotient of kets by the global phase equivalence relation. Let be a property (predicate) defined on . If holds for every ket (where denotes the equivalence class of ), then holds for every state .
The Quotient Map from Kets to Phase-Equivalent States is Surjective
The quotient map , which maps a quantum state vector to its equivalence class under global phase, is a surjective function. That is, every pure quantum state in can be represented by at least one ket .
