Tensor products of vectors, states, operators, and gates #
Raw tensor products are defined at the StateVector and HilbertOperator
layers. PureState.tensor and Gate.tensor wrap these raw tensors with the
normalization/unitarity proofs needed to stay in their semantic types.
noncomputable def
QuantumAlg.StateVector.tensor
{m n : ℕ}
(ψ : StateVector m)
(φ : StateVector n)
:
StateVector (m + n)
Tensor product of raw Hilbert-space vectors.
Equations
- ψ.tensor φ = WithLp.toLp 2 fun (i : Fin (2 ^ (m + n))) => ψ.ofLp (QuantumAlg.prodEquiv.symm i).1 * φ.ofLp (QuantumAlg.prodEquiv.symm i).2
Instances For
@[simp]
@[simp]
@[simp]
theorem
QuantumAlg.StateVector.smul_tensor
{m n : ℕ}
(c : ℂ)
(ψ : StateVector m)
(φ : StateVector n)
:
@[simp]
@[simp]
@[simp]
theorem
QuantumAlg.StateVector.tensor_smul
{m n : ℕ}
(c : ℂ)
(ψ : StateVector m)
(φ : StateVector n)
:
@[simp]
@[simp]
@[simp]
@[simp]
The norm is multiplicative under tensor products.
theorem
QuantumAlg.StateVector.inner_tensor_tensor
{m n : ℕ}
(ψ ψ' : StateVector m)
(φ φ' : StateVector n)
:
The inner product factors over tensor products.
theorem
QuantumAlg.PureState.smul_tensor
{m n : ℕ}
(c : ℂ)
(ψ : StateVector m)
(φ : StateVector n)
:
theorem
QuantumAlg.PureState.tensor_smul
{m n : ℕ}
(c : ℂ)
(ψ : StateVector m)
(φ : StateVector n)
:
noncomputable def
QuantumAlg.HilbertOperator.tensor
{m n : ℕ}
(G : HilbertOperator m)
(K : HilbertOperator n)
:
HilbertOperator (m + n)
Tensor product of Hilbert-space operators.
Equations
- G.tensor K = (Matrix.reindex QuantumAlg.prodEquiv QuantumAlg.prodEquiv) (Matrix.kroneckerMap (fun (x1 x2 : ℂ) => x1 * x2) G K)
Instances For
@[simp]
@[simp]
theorem
QuantumAlg.HilbertOperator.add_tensor
{m n : ℕ}
(G G' : HilbertOperator m)
(K : HilbertOperator n)
:
theorem
QuantumAlg.HilbertOperator.tensor_add
{m n : ℕ}
(G : HilbertOperator m)
(K K' : HilbertOperator n)
:
theorem
QuantumAlg.HilbertOperator.tensor_mul_tensor
{m n : ℕ}
(G G' : HilbertOperator m)
(K K' : HilbertOperator n)
:
theorem
QuantumAlg.HilbertOperator.conjTranspose_tensor
{m n : ℕ}
(G : HilbertOperator m)
(K : HilbertOperator n)
:
theorem
QuantumAlg.HilbertOperator.tensor_mem_unitaryGroup
{m n : ℕ}
{G : HilbertOperator m}
{K : HilbertOperator n}
(hG : G ∈ Matrix.unitaryGroup (Fin (2 ^ m)) ℂ)
(hK : K ∈ Matrix.unitaryGroup (Fin (2 ^ n)) ℂ)
:
theorem
QuantumAlg.HilbertOperator.tensor_applyVec_tensor
{m n : ℕ}
(G : HilbertOperator m)
(K : HilbertOperator n)
(ψ : StateVector m)
(φ : StateVector n)
:
theorem
QuantumAlg.Gate.tensor_applyVec_tensor
{m n : ℕ}
(G : Gate m)
(K : Gate n)
(ψ : StateVector m)
(φ : StateVector n)
: