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] extends (selfAdjoint (Matrix d d )) :
Type u_1

A mixed state as a PSD matrix with trace 1.

Instances For
    def MState.m {d : Type u_1} [Fintype d] (ρ : MState d) :

    The underlying Matrix in an MState

    Equations
    Instances For
      @[reducible]
      def MState.M {d : Type u_1} [Fintype d] (ρ : MState d) :

      The underlying HermitianMat in an MState

      Equations
      Instances For
        instance MState.instCoe {d : Type u_1} [Fintype d] :
        Equations
        @[simp]
        theorem MState.tr' {d : Type u_1} [Fintype d] (ρ : MState d) :
        (↑ρ).trace = 1
        @[simp]
        theorem MState.toSubtype_eq_coe {d : Type u_1} [Fintype d] (ρ : MState d) :
        ρ.toSubtype = ρ
        theorem MState.ext {d : Type u_1} [Fintype d] {ρ₁ ρ₂ : MState d} (h : ρ₁ = ρ₂) :
        ρ₁ = ρ₂
        theorem MState.pos {d : Type u_1} [Fintype d] (ρ : MState d) :
        theorem MState.Hermitian {d : Type u_1} [Fintype d] (ρ : MState d) :

        Every mixed state is Hermitian.

        theorem MState.ext_m {d : Type u_1} [Fintype 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] :

        The matrices corresponding to MStates are Convex

        instance MState.instMixable {d : Type u_1} [Fintype d] :
        Equations
        instance MState.nonempty {d : Type u_1} [Fintype d] (ρ : MState d) :
        def MState.inner {d : Type u_1} [Fintype d] (ρ σ : MState d) :

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

        Equations
        Instances For
          def MState.exp_val_ℂ {d : Type u_1} [Fintype d] (T : Matrix d d ) (ρ : MState d) :
          Equations
          Instances For
            def MState.exp_val {d : Type u_1} [Fintype d] (T : HermitianMat d ) (ρ : MState d) :
            Equations
            Instances For
              theorem MState.exp_val_nonneg {d : Type u_1} [Fintype d] {T : HermitianMat d } (h : 0 T) (ρ : MState d) :
              0 exp_val T ρ
              theorem MState.exp_val_le_one {d : Type u_1} [Fintype d] [DecidableEq d] {T : HermitianMat d } (h : T 1) (ρ : MState d) :
              exp_val T ρ 1
              theorem MState.exp_val_prob {d : Type u_1} [Fintype d] [DecidableEq d] {T : HermitianMat d } (h : 0 T T 1) (ρ : MState d) :
              0 exp_val T ρ exp_val T ρ 1
              def MState.pure {d : Type u_1} [Fintype d] (ψ : Ket d) :

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

              Equations
              Instances For
                @[simp]
                theorem MState.pure_of {d : Type u_1} [Fintype d] {i j : d} (ψ : Ket d) :
                (pure ψ).m i j = ψ i * (starRingEnd ) (ψ j)
                def MState.purity {d : Type u_1} [Fintype 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
                  def MState.spectrum {d : Type u_1} [Fintype d] (ρ : MState d) :

                  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] (ψ : Ket d) :
                    ∃ (i : d), (pure ψ).spectrum = Distribution.constant i

                    The specturm 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] (ρ : MState d) (h : ∃ (i : d), ρ.spectrum = Distribution.constant i) :
                    ∃ (ψ : Ket d), ρ = pure ψ

                    If the specturm 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] (ρ : MState d) :
                    (∃ (ψ : Ket d), ρ = pure ψ) ∃ (i : d), ρ.spectrum = Distribution.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] (ρ : MState d) :
                    (∃ (ψ : Ket d), ρ = pure ψ) ρ.purity = 1
                    def MState.prod {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] (ρ₁ : MState d₁) (ρ₂ : MState d₂) :
                    MState (d₁ × d₂)
                    Equations
                    Instances For
                      theorem MState.pure_prod_pure {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] (ψ₁ : Ket d₁) (ψ₂ : Ket d₂) :
                      pure (ψ₁ψ₂) = pure ψ₁pure ψ₂

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

                      def MState.ofClassical {d : Type u_1} [Fintype d] (dist : Distribution d) :

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

                      Equations
                      Instances For
                        def MState.uniform {d : Type u_1} [Fintype d] [Nonempty d] :

                        The maximally mixed state.

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

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

                          Equations
                          instance MState.instInhabited {d : Type u_1} [Fintype d] [Nonempty d] :

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

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

                          Partial tracing out the left half of a system.

                          Equations
                          Instances For
                            def MState.traceRight {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] (ρ : MState (d₁ × d₂)) :
                            MState d₁

                            Partial tracing out the right half of a system.

                            Equations
                            Instances For
                              @[simp]
                              theorem MState.traceLeft_prod_eq {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype 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₂] (ρ₁ : 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₂] (ρ₁ : 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 ρ₂.

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

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

                              Equations
                              • One or more equations did not get rendered due to their size.
                              Instances For
                                theorem MState.IsSeparable_prod {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] (ρ₁ : MState d₁) (ρ₂ : MState d₂) :
                                (ρ₁ρ₂).IsSeparable

                                A product state MState.prod is separable.

                                theorem MState.pure_separable_iff_IsProd {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] (ψ : Ket (d₁ × d₂)) :

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

                                theorem MState.pure_separable_iff_traceLeft_pure {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype 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] (ρ : 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] (ρ : 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] (ρ : 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₂] (ρ : 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₂] (ρ : MState d₁) (e : d₂ d₁) :
                                      (ρ.relabel e).m = ρ.m.submatrix e e
                                      def MState.SWAP {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype 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
                                        def MState.spectrum_SWAP {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype 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₂] (ρ : MState (d₁ × d₂)) :
                                          ρ.SWAP.SWAP = ρ
                                          @[simp]
                                          theorem MState.traceLeft_SWAP {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype d₂] (ρ : MState (d₁ × d₂)) :
                                          @[simp]
                                          theorem MState.traceRight_SWAP {d₁ : Type u_2} {d₂ : Type u_3} [Fintype d₁] [Fintype 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₃] (ρ : 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₃] (ρ : 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₃] (ρ : 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₃] (ρ : 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₃] (ρ : 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₃] (ρ : 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₃] (ρ : 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₃] (ρ : 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₃] (ρ : 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₃] (ρ : MState (d₁ × d₂ × d₃)) :
                                              @[simp]
                                              theorem MState.traceNorm_eq_1 {d : Type u_1} [Fintype d] (ρ : MState d) :

                                              Mixed states inherit the subspace topology from matrices

                                              Equations

                                              The projection from mixed states to their matrices is an embedding

                                              def MState.piProd {ι : Type u} [DecidableEq ι] [fι : Fintype ι] {dI : ιType v} [(i : ι) → Fintype (dI i)] (ρi : (i : ι) → MState (dI i)) :
                                              MState ((i : ι) → dI i)
                                              Equations
                                              • MState.piProd ρi = { toSubtype := fun (j k : (i : ι) → dI i) => i : ι, (ρi i).m (j i) (k i), , zero_le := , tr := }
                                              Instances For
                                                def MState.npow {d : Type u_1} [Fintype d] (ρ : MState d) (n : ) :
                                                MState (Fin nd)
                                                Equations
                                                Instances For