Physlib Documentation

QuantumInfo.Finite.MState

Finite dimensional quantum mixed states, ρ.

The same comments apply as in Braket:

These could be done with a Hilbert space of Fintype, which would look like

(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.

Important definitions:

structure MState (d : Type u_1) [Fintype d] [DecidableEq d] :
Type u_1

A mixed quantum state is a PSD matrix with trace 1.

We don't extend (M : HermitianMat d ℂ) because that gives an annoying thing where M is actually a Subtype, which means ρ.M.foo notation doesn't work.

Instances For
    theorem MState.ext_iff {d : Type u_1} {inst✝ : Fintype d} {inst✝¹ : DecidableEq d} {x y : MState d} :
    x = y x = y
    theorem MState.ext {d : Type u_1} {inst✝ : Fintype d} {inst✝¹ : DecidableEq d} {x y : MState d} (M : x = y) :
    x = y
    instance MState.instCoe {d : Type u_1} [Fintype d] [DecidableEq d] :
    Equations
    def MState.m {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :

    The underlying Matrix in an MState. Prefer MState.M for the HermitianMat.

    Equations
    • ρ.m = ρ
    Instances For
      @[simp]
      theorem MState.mat_M {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
      ρ = ρ.m
      theorem MState.pos {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
      0 < ρ

      Positivity extension for MState.M: it is always positive (0 < ρ.M). Note: we must not call whnfR on e because MState.M is a structure projection (reducible), so whnfR would reduce it and destroy the pattern.

      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        theorem MState.psd {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
        theorem MState.Hermitian {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :

        Every mixed state is Hermitian.

        @[simp]
        theorem MState.tr' {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
        ρ.m.trace = 1
        theorem MState.ext_m {d : Type u_1} [Fintype d] [DecidableEq d] {ρ₁ ρ₂ : MState d} (h : ρ₁.m = ρ₂.m) :
        ρ₁ = ρ₂

        The map from mixed states to their matrices is injective

        theorem MState.convex (d : Type u_1) [Fintype d] [DecidableEq d] :

        The matrices corresponding to MStates are Convex

        Equations
        instance MState.nonempty {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
        theorem MState.eigenvalue_nonneg {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) (i : d) :
        theorem MState.eigenvalue_le_one {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) (i : d) :
        theorem MState.le_one {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
        ρ 1

        The inner product of two MState's, as a real number between 0 and 1.

        Equations
        Instances For
          theorem MState.inner_def {d : Type u_1} [Fintype d] [DecidableEq d] (ρ σ : MState d) :
          inner Prob ρ σ = inner ρ σ,
          theorem MState.val_inner {d : Type u_1} [Fintype d] [DecidableEq d] (ρ σ : MState d) :
          (inner Prob ρ σ) = inner ρ σ
          def MState.exp_val_ℂ {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) (T : Matrix d d ) :
          Equations
          Instances For
            def MState.exp_val {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) (T : HermitianMat d ) :

            The expectation value of an operator on a quantum state.

            Equations
            Instances For
              theorem MState.exp_val_nonneg {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) {T : HermitianMat d } (h : 0 T) :
              0 ρ.exp_val T
              @[simp]
              theorem MState.exp_val_zero {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
              ρ.exp_val 0 = 0
              @[simp]
              theorem MState.exp_val_one {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
              ρ.exp_val 1 = 1
              theorem MState.exp_val_le_one {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) {T : HermitianMat d } (h : T 1) :
              ρ.exp_val T 1
              theorem MState.exp_val_prob {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) {T : HermitianMat d } (h : 0 T T 1) :
              0 ρ.exp_val T ρ.exp_val T 1
              theorem MState.exp_val_sub {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) (A B : HermitianMat d ) :
              ρ.exp_val (A - B) = ρ.exp_val A - ρ.exp_val B
              theorem MState.exp_val_eq_zero_iff {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) {A : HermitianMat d } (hA₁ : 0 A) :
              ρ.exp_val A = 0 (↑ρ).support A.ker

              If a PSD observable A has expectation value of 0 on a state ρ, it must entirely contain the support of ρ in its kernel.

              theorem MState.exp_val_eq_one_iff {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) {A : HermitianMat d } (hA₂ : A 1) :
              ρ.exp_val A = 1 (↑ρ).support (1 - A).ker

              If an observable A has expectation value of 1 on a state ρ, it must entirely contain the support of ρ in its 1-eigenspace.

              theorem MState.exp_val_add {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) (A B : HermitianMat d ) :
              ρ.exp_val (A + B) = ρ.exp_val A + ρ.exp_val B
              @[simp]
              theorem MState.exp_val_smul {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) (r : ) (A : HermitianMat d ) :
              ρ.exp_val (r A) = r * ρ.exp_val A
              theorem MState.exp_val_le_exp_val {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) {A B : HermitianMat d } (h : A B) :
              ρ.exp_val A ρ.exp_val B
              def MState.pure {d : Type u_1} [Fintype d] [DecidableEq d] (ψ : Ket d) :

              A mixed state can be constructed as a pure state arising from a ket.

              Equations
              Instances For
                @[simp]
                theorem MState.pure_apply {d : Type u_1} [Fintype d] [DecidableEq d] (ψ : Ket d) {i j : d} :
                (pure ψ).m i j = ψ i * (starRingEnd ) (ψ j)
                theorem MState.pure_mul_self {d : Type u_1} [Fintype d] [DecidableEq d] (ψ : Ket d) :
                (pure ψ).m * (pure ψ).m = (pure ψ)
                def MState.purity {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :

                The purity of a state is Tr[ρ^2]. This is a Prob, because it is always between zero and one.

                Equations
                Instances For

                  The eigenvalue spectrum of a mixed quantum state, as a Distribution.

                  Equations
                  Instances For
                    theorem MState.spectrum_pure_eq_constant {d : Type u_1} [Fintype d] [DecidableEq d] (ψ : Ket d) :

                    The spectrum of a pure state is (1,0,0,...), i.e. a constant distribution.

                    theorem MState.pure_of_constant_spectrum {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) (h : ∃ (i : d), ρ.spectrum = ProbDistribution.constant i) :
                    ∃ (ψ : Ket d), ρ = pure ψ

                    If the spectrum of a mixed state is (1,0,0...) i.e. a constant distribution, it is a pure state.

                    theorem MState.pure_iff_constant_spectrum {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
                    (∃ (ψ : Ket d), ρ = pure ψ) ∃ (i : d), ρ.spectrum = ProbDistribution.constant i

                    A state ρ is pure iff its spectrum is (1,0,0,...) i.e. a constant distribution.

                    theorem MState.pure_iff_purity_one {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
                    (∃ (ψ : Ket d), ρ = pure ψ) ρ.purity = 1
                    theorem MState.spectralDecomposition {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
                    ∃ (ψs : dKet d), ρ = i : d, (ρ.spectrum i) (pure (ψs i))
                    def MState.prod {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ₁ : MState d₁) (ρ₂ : MState d₂) :
                    MState (d₁ × d₂)
                    Equations
                    Instances For
                      theorem MState.prod_inner_prod {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ξ1 ψ1 : MState d₁) (ξ2 ψ2 : MState d₂) :
                      inner Prob (ξ1 ⊗ᴹ ξ2) (ψ1 ⊗ᴹ ψ2) = inner Prob ξ1 ψ1 * inner Prob ξ2 ψ2
                      theorem MState.pure_prod_pure {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ψ₁ : Ket d₁) (ψ₂ : Ket d₂) :
                      pure (ψ₁ ⊗ᵠ ψ₂) = pure ψ₁ ⊗ᴹ pure ψ₂

                      The product of pure states is a pure product state , Ket.prod.

                      A representation of a classical distribution as a quantum state, diagonal in the given basis.

                      Equations
                      Instances For
                        @[simp]
                        theorem MState.coe_ofClassical {d : Type u_1} [Fintype d] [DecidableEq d] (dist : ProbDistribution d) :
                        (ofClassical dist) = HermitianMat.diagonal fun (x : d) => (dist x)
                        theorem MState.ofClassical_pow {d : Type u_1} [Fintype d] [DecidableEq d] (dist : ProbDistribution d) (p : ) :
                        (ofClassical dist) ^ p = HermitianMat.diagonal fun (i : d) => (dist i) ^ p
                        def MState.uniform {d : Type u_1} [Fintype d] [DecidableEq d] [Nonempty d] :

                        The maximally mixed state.

                        Equations
                        Instances For
                          instance MState.instUnique {d : Type u_1} [Fintype d] [DecidableEq d] [Unique d] :

                          There is exactly one state on a dimension-1 system.

                          Equations

                          There exists a mixed state for every nonempty d. Here, the maximally mixed one is chosen.

                          Equations
                          @[simp]
                          theorem MState.M_default {d : Type u_1} [Fintype d] [DecidableEq d] [Unique d] :
                          default = 1
                          def MState.traceLeft {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState (d₁ × d₂)) :
                          MState d₂

                          Partial tracing out the left half of a system.

                          Equations
                          Instances For
                            @[simp]
                            theorem MState.traceLeft_M {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState (d₁ × d₂)) :
                            ρ.traceLeft = (↑ρ).traceLeft
                            def MState.traceRight {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState (d₁ × d₂)) :
                            MState d₁

                            Partial tracing out the right half of a system.

                            Equations
                            Instances For
                              @[simp]
                              theorem MState.traceRight_M {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState (d₁ × d₂)) :
                              ρ.traceRight = (↑ρ).traceRight
                              @[simp]
                              theorem MState.traceLeft_prod_eq {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ₁ : MState d₁) (ρ₂ : MState d₂) :
                              (ρ₁ ⊗ᴹ ρ₂).traceLeft = ρ₂

                              Taking the direct product on the left and tracing it back out gives the same state.

                              @[simp]
                              theorem MState.traceRight_prod_eq {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ₁ : MState d₁) (ρ₂ : MState d₂) :
                              (ρ₁ ⊗ᴹ ρ₂).traceRight = ρ₁

                              Taking the direct product on the right and tracing it back out gives the same state.

                              theorem MState.spectrum_prod {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ₁ : MState d₁) (ρ₂ : MState d₂) :
                              ∃ (σ : d₁ × d₂ d₁ × d₂), ∀ (i : d₁) (j : d₂), (ρ₁ ⊗ᴹ ρ₂).spectrum (σ (i, j)) = ρ₁.spectrum i * ρ₂.spectrum j

                              Spectrum of direct product. There is a permutation σ so that the spectrum of the direct product of ρ₁ and ρ₂, as permuted under σ, is the pairwise products of the spectra of ρ₁ and ρ₂.

                              theorem MState.sInf_spectrum_prod {d : Type u_1} {d₂ : Type u_3} [Fintype d] [Fintype d₂] [DecidableEq d] [DecidableEq d₂] (ρ : MState d) (σ : MState d₂) :
                              def MState.IsSeparable {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState (d₁ × d₂)) :

                              A mixed state is separable iff it can be written as a convex combination of product mixed states.

                              Equations
                              Instances For
                                theorem MState.IsSeparable_prod {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ₁ : MState d₁) (ρ₂ : MState d₂) :
                                (ρ₁ ⊗ᴹ ρ₂).IsSeparable

                                A product state MState.prod is separable.

                                theorem MState.eq_of_sum_eq_pure {d : Type u_5} [Fintype d] [DecidableEq d] {ι : Type u_6} {s : Finset ι} {p : ι} {ρs : ιMState d} {ρ : MState d} (h_pure : ρ.purity = 1) (h_sum : ρ = is, p i (ρs i)) (hp_nonneg : is, 0 p i) (hp_sum : is, p i = 1) (i : ι) (hi : i s) (hpi : 0 < p i) :
                                ρs i = ρ
                                theorem MState.purity_prod {d₁ : Type u_5} {d₂ : Type u_6} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ₁ : MState d₁) (ρ₂ : MState d₂) :
                                (ρ₁ ⊗ᴹ ρ₂).purity = ρ₁.purity * ρ₂.purity
                                theorem MState.pure_eq_pure_iff {d : Type u_5} [Fintype d] [DecidableEq d] (ψ φ : Ket d) :
                                pure ψ = pure φ ∃ (z : ), z = 1 ψ.vec = z φ.vec
                                theorem MState.PhaseEquiv_iff_pure_eq {d : Type u_5} [Fintype d] [DecidableEq d] (ψ φ : Ket d) :

                                Two kets are phase-equivalent if and only if their pure states are equal.

                                def MState.pureQ {d : Type u_5} [Fintype d] [DecidableEq d] :

                                MState.pure descends to the quotient KetUpToPhase.

                                Equations
                                Instances For
                                  @[simp]
                                  theorem MState.pureQ_mk {d : Type u_5} [Fintype d] [DecidableEq d] (ψ : Ket d) :
                                  theorem MState.pure_separable_imp_IsProd {d₁ : Type u_5} {d₂ : Type u_6} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ψ : Ket (d₁ × d₂)) (h : (pure ψ).IsSeparable) :
                                  theorem MState.pure_separable_iff_IsProd {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ψ : Ket (d₁ × d₂)) :

                                  A pure state is separable iff the ket is a product state.

                                  theorem MState.pure_iff_rank_eq_one {d : Type u_5} [Fintype d] [DecidableEq d] (ρ : MState d) :
                                  (∃ (ψ : Ket d), ρ = pure ψ) ρ.m.rank = 1

                                  A mixed state is pure if and only if its rank is 1.

                                  theorem MState.Ket.IsProd_iff_rank_eq_one {d₁ : Type u_5} {d₂ : Type u_6} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ψ : Ket (d₁ × d₂)) :
                                  ψ.IsProd (Matrix.of fun (i : d₁) (j : d₂) => ψ (i, j)).rank = 1

                                  A ket on a product space is a product state if and only if its coefficient matrix has rank 1.

                                  theorem MState.pure_separable_iff_traceLeft_pure {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ψ : Ket (d₁ × d₂)) :
                                  (pure ψ).IsSeparable ∃ (ψ₁ : Ket d₂), pure ψ₁ = (pure ψ).traceLeft

                                  A pure state is separable iff the partial trace on the left is pure.

                                  def MState.purify {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
                                  Ket (d × d)

                                  The purification of a mixed state. Always uses the full dimension of the Hilbert space (d) to purify, so e.g. an existing pure state with d=4 still becomes d=16 in the purification. The defining property is MState.traceRight_of_purify; see also MState.purify' for the bundled version.

                                  Equations
                                  Instances For
                                    @[simp]
                                    theorem MState.purify_spec {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :

                                    The defining property of purification, that tracing out the purifying system gives the original mixed state.

                                    def MState.purifyX {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
                                    { ψ : Ket (d × d) // (pure ψ).traceRight = ρ }

                                    MState.purify bundled with its defining property MState.traceRight_of_purify.

                                    Equations
                                    Instances For
                                      def MState.relabel {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState d₁) (e : d₂ d₁) :
                                      MState d₂
                                      Equations
                                      Instances For
                                        @[simp]
                                        theorem MState.relabel_M {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState d₁) (e : d₂ d₁) :
                                        (ρ.relabel e) = (↑ρ).reindex e.symm
                                        @[simp]
                                        theorem MState.relabel_m {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState d₁) (e : d₂ d₁) :
                                        (ρ.relabel e).m = ρ.m.submatrix e e
                                        @[simp]
                                        theorem MState.relabel_refl {d : Type u_5} [Fintype d] [DecidableEq d] (ρ : MState d) :
                                        ρ.relabel (Equiv.refl d) = ρ
                                        theorem MState.relabel_pure_exists {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ψ : Ket d₁) (e : d₂ d₁) :
                                        ∃ (ψ' : Ket d₂), (pure ψ).relabel e = pure ψ'

                                        Relabeling a pure state by a bijection yields another pure state.

                                        @[simp]
                                        theorem MState.relabel_relabel {d : Type u_5} {d₂ : Type u_6} {d₃ : Type u_7} [Fintype d] [DecidableEq d] [Fintype d₂] [DecidableEq d₂] [Fintype d₃] [DecidableEq d₃] (ρ : MState d) (e : d₂ d) (e₂ : d₃ d₂) :
                                        (ρ.relabel e).relabel e₂ = ρ.relabel (e₂.trans e)
                                        theorem MState.eq_relabel_iff {d₁ d₂ : Type u} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂] (ρ : MState d₁) (σ : MState d₂) (h : d₁ d₂) :
                                        ρ = σ.relabel h ρ.relabel h.symm = σ
                                        theorem MState.relabel_comp {d₁ : Type u_5} {d₂ : Type u_6} {d₃ : Type u_7} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂] [Fintype d₃] [DecidableEq d₃] (ρ : MState d₁) (e : d₂ d₁) (f : d₃ d₂) :
                                        (ρ.relabel e).relabel f = ρ.relabel (f.trans e)
                                        theorem MState.relabel_cast {d₁ d₂ : Type u} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂] (ρ : MState d₁) (e : d₂ = d₁) :
                                        ρ.relabel (Equiv.cast e) = cast ρ
                                        @[simp]
                                        theorem MState.spectrum_relabel {d : Type u_1} {d₂ : Type u_3} [Fintype d] [Fintype d₂] [DecidableEq d] [DecidableEq d₂] {ρ : MState d} (e : d₂ d) :
                                        @[simp]
                                        theorem MState.purity_relabel {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState d₁) (e : d₂ d₁) :

                                        The purity of a state is invariant under relabeling of the basis.

                                        def MState.SWAP {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState (d₁ × d₂)) :
                                        MState (d₂ × d₁)

                                        The heterogeneous SWAP gate that exchanges the left and right halves of a quantum system. This can apply even when the two "halves" are of different types, as opposed to (say) the SWAP gate on quantum circuits that leaves the qubit dimensions unchanged. Notably, it is not unitary.

                                        Equations
                                        Instances For
                                          theorem MState.multiset_spectrum_relabel_eq {d₁ : Type u_5} {d₂ : Type u_6} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂] (ρ : MState d₁) (e : d₂ d₁) :

                                          The multiset of values in the spectrum of a relabeled state is the same as the multiset of values in the spectrum of the original state.

                                          def MState.spectrum_SWAP {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState (d₁ × d₂)) :
                                          ∃ (e : d₁ × d₂ d₂ × d₁), ρ.SWAP.spectrum.relabel e = ρ.spectrum
                                          Equations
                                          • =
                                          Instances For
                                            @[simp]
                                            theorem MState.SWAP_SWAP {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState (d₁ × d₂)) :
                                            ρ.SWAP.SWAP = ρ
                                            @[simp]
                                            theorem MState.traceLeft_SWAP {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState (d₁ × d₂)) :
                                            @[simp]
                                            theorem MState.traceRight_SWAP {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] [DecidableEq d₁] [DecidableEq d₂] (ρ : MState (d₁ × d₂)) :
                                            def MState.assoc {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState ((d₁ × d₂) × d₃)) :
                                            MState (d₁ × d₂ × d₃)

                                            The associator that re-clusters the parts of a quantum system.

                                            Equations
                                            Instances For
                                              def MState.assoc' {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState (d₁ × d₂ × d₃)) :
                                              MState ((d₁ × d₂) × d₃)

                                              The associator that re-clusters the parts of a quantum system.

                                              Equations
                                              Instances For
                                                @[simp]
                                                theorem MState.assoc_assoc' {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState (d₁ × d₂ × d₃)) :
                                                ρ.assoc'.assoc = ρ
                                                @[simp]
                                                theorem MState.assoc'_assoc {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState ((d₁ × d₂) × d₃)) :
                                                ρ.assoc.assoc' = ρ
                                                @[simp]
                                                theorem MState.traceLeft_right_assoc {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState ((d₁ × d₂) × d₃)) :
                                                @[simp]
                                                theorem MState.traceRight_left_assoc' {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState (d₁ × d₂ × d₃)) :
                                                @[simp]
                                                theorem MState.traceRight_assoc {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState ((d₁ × d₂) × d₃)) :
                                                @[simp]
                                                theorem MState.traceLeft_assoc' {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState (d₁ × d₂ × d₃)) :
                                                @[simp]
                                                theorem MState.traceLeft_left_assoc {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState ((d₁ × d₂) × d₃)) :
                                                @[simp]
                                                theorem MState.traceRight_right_assoc' {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState (d₁ × d₂ × d₃)) :
                                                @[simp]
                                                theorem MState.traceNorm_eq_1 {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) :
                                                theorem MState.relabel_kron {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState d₁) (σ : MState d₂) (e : d₃ d₁) :
                                                ρ.relabel e ⊗ᴹ σ = (ρ ⊗ᴹ σ).relabel (e.prodCongr (Equiv.refl d₂))
                                                theorem MState.kron_relabel {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState d₁) (σ : MState d₂) (e : d₃ d₂) :
                                                ρ ⊗ᴹ σ.relabel e = (ρ ⊗ᴹ σ).relabel ((Equiv.refl d₁).prodCongr e)
                                                theorem MState.prod_assoc {d₁ : Type u_2} {d₂ : Type u_3} {d₃ : Type u_4} [Fintype d₁] [Fintype d₂] [Fintype d₃] [DecidableEq d₁] [DecidableEq d₂] [DecidableEq d₃] (ρ : MState d₁) (σ : MState d₂) (τ : MState d₃) :
                                                ρ ⊗ᴹ (σ ⊗ᴹ τ) = (ρ ⊗ᴹ σ ⊗ᴹ τ).relabel (Equiv.prodAssoc d₁ d₂ d₃).symm

                                                Mixed states inherit the subspace topology from matrices

                                                Equations

                                                The projection from mixed states to their Hermitian matrices is an embedding

                                                theorem MState.dist_eq {d : Type u_1} [Fintype d] [DecidableEq d] (x y : MState d) :
                                                dist x y = dist x y
                                                def MState.piProd {ι : Type u} [DecidableEq ι] [ : Fintype ι] {dI : ιType v} [(i : ι) → Fintype (dI i)] [(i : ι) → DecidableEq (dI i)] (ρi : (i : ι) → MState (dI i)) :
                                                MState ((i : ι) → dI i)
                                                Equations
                                                Instances For
                                                  def MState.npow {d : Type u_1} [Fintype d] [DecidableEq d] (ρ : MState d) (n : ) :
                                                  MState (Fin nd)

                                                  The n-copy "power" of a mixed state, with the standard basis indexed by pi types.

                                                  Equations
                                                  Instances For

                                                    The n-copy "power" of a mixed state, with the standard basis indexed by pi types.

                                                    Equations
                                                    Instances For
                                                      theorem MState.PosDef.kron {d₁ : Type u_5} {d₂ : Type u_6} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂] {σ₁ : MState d₁} {σ₂ : MState d₂} (hσ₁ : σ₁.m.PosDef) (hσ₂ : σ₂.m.PosDef) :
                                                      (σ₁ ⊗ᴹ σ₂).m.PosDef
                                                      theorem MState.PosDef.relabel {d₁ : Type u_5} {d₂ : Type u_6} [Fintype d₁] [DecidableEq d₁] [Fintype d₂] [DecidableEq d₂] {ρ : MState d₁} ( : ρ.m.PosDef) (e : d₂ d₁) :
                                                      theorem MState.PosDef_mix {d : Type u_5} [Fintype d] [DecidableEq d] {σ₁ σ₂ : MState d} (hσ₁ : σ₁.m.PosDef) (hσ₂ : σ₂.m.PosDef) (p : Prob) :
                                                      p[σ₁σ₂].m.PosDef

                                                      If both states positive definite, so is their mixture.

                                                      theorem MState.PosDef_mix_of_ne_zero {d : Type u_5} [Fintype d] [DecidableEq d] {σ₁ σ₂ : MState d} (hσ₁ : σ₁.m.PosDef) (p : Prob) (hp : p 0) :
                                                      p[σ₁σ₂].m.PosDef

                                                      If one state is positive definite and the mixture is nondegenerate, their mixture is also positive definite.

                                                      theorem MState.PosDef_mix_of_ne_one {d : Type u_5} [Fintype d] [DecidableEq d] {σ₁ σ₂ : MState d} (hσ₂ : σ₂.m.PosDef) (p : Prob) (hp : p 1) :
                                                      p[σ₁σ₂].m.PosDef

                                                      If the second state is positive definite and the mixture is nondegenerate, their mixture is also positive definite.

                                                      theorem MState.posDef_of_unique {d : Type u_5} [Fintype d] [DecidableEq d] (ρ : MState d) [Unique d] :