Documentation

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

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

structure Ket (d : Type u_1) [Fintype d] :
Type u_1

A ket as a vector of unit norm. We follow the convention in Matrix of vectors as simple functions from a Fintype. Kets are distinctly not a vector space in our notion, as they represent only normalized states and so cannot (in general) be added or scaled.

Instances For
    structure Bra (d : Type u_1) [Fintype d] :
    Type u_1

    A bra is definitionally identical to a Ket, but are separate to avoid complex conjugation confusion. They can be interconverted with the adjoint: Ket.to_bra and Bra.to_ket

    Instances For
      Equations
      • One or more equations did not get rendered due to their size.
      Instances For
        Equations
        • One or more equations did not get rendered due to their size.
        Instances For
          instance Braket.instFunLikeKet {d : Type u_1} [Fintype d] :
          Equations
          instance Braket.instFunLikeBra {d : Type u_1} [Fintype d] :
          Equations
          def Braket.dot {d : Type u_1} [Fintype d] (ξ : Bra d) (ψ : Ket d) :
          Equations
          Instances For
            Equations
            • One or more equations did not get rendered due to their size.
            Instances For
              theorem Ket.apply {d : Type u_1} [Fintype d] (ψ : Ket d) (i : d) :
              ψ i = ψ.vec i
              theorem Bra.apply {d : Type u_1} [Fintype d] (ψ : Bra d) (i : d) :
              ψ i = ψ.vec i
              theorem Ket.ext {d : Type u_1} [Fintype d] {ξ ψ : Ket d} (h : ∀ (x : d), ξ x = ψ x) :
              ξ = ψ
              theorem Bra.ext {d : Type u_1} [Fintype d] {ξ ψ : Bra d} (h : ∀ (x : d), ξ x = ψ x) :
              ξ = ψ
              theorem Ket.normalized {d : Type u_1} [Fintype d] (ψ : Ket d) :
              x : d, Complex.normSq (ψ x) = 1
              theorem Bra.normalized {d : Type u_1} [Fintype d] (ψ : Bra d) :
              x : d, Complex.normSq (ψ x) = 1
              def Ket.to_bra {d : Type u_1} [Fintype d] (ψ : Ket d) :
              Bra d

              Any Bra can be turned into a Ket by conjugating the elements.

              Equations
              Instances For
                def Bra.to_ket {d : Type u_1} [Fintype d] (ψ : Bra d) :
                Ket d

                Any Ket can be turned into a Bra by conjugating the elements.

                Equations
                Instances For
                  instance instBraOfKet {d : Type u_1} [Fintype d] :
                  Coe (Ket d) (Bra d)
                  Equations
                  instance instKetOfBra {d : Type u_1} [Fintype d] :
                  Coe (Bra d) (Ket d)
                  Equations
                  @[simp]
                  theorem Bra.eq_conj {d : Type u_1} [Fintype d] (ψ : Ket d) (x : d) :
                  ψ x = (starRingEnd ) (ψ x)
                  theorem Bra.apply' {d : Type u_1} [Fintype d] (ψ : Ket d) (i : d) :
                  ψ i = (starRingEnd ) (ψ.vec i)
                  theorem Ket.exists_ne_zero {d : Type u_1} [Fintype d] (ψ : Ket d) :
                  ∃ (x : d), ψ x 0
                  theorem Bra.exists_ne_zero {d : Type u_1} [Fintype d] (ψ : Bra d) :
                  ∃ (x : d), ψ x 0
                  def Ket.normalize {d : Type u_1} [Fintype d] (v : d) (h : ∃ (x : d), v x 0) :
                  Ket d

                  Create a ket out of a vector given it has a nonzero component

                  Equations
                  Instances For
                    theorem Ket.normalize_ket_eq_self {d : Type u_1} [Fintype d] (ψ : Ket d) :
                    normalize ψ.vec = ψ

                    A ket is already normalized

                    def Bra.normalize {d : Type u_1} [Fintype d] (v : d) (h : ∃ (x : d), v x 0) :
                    Bra d

                    Create a bra out of a vector given it has a nonzero component

                    Equations
                    Instances For
                      def Bra.normalize_ket_eq_self {d : Type u_1} [Fintype d] (ψ : Bra d) :
                      normalize ψ.vec = ψ

                      A bra is already normalized

                      Equations
                      • =
                      Instances For
                        def uniform_superposition {d : Type u_1} [Fintype d] [hdne : Nonempty d] :
                        Ket d

                        Ket form by the superposition of all elements in d. Commonly denoted by |+⟩, especially for qubits

                        Equations
                        Instances For
                          instance instInhabited {d : Type u_1} [Fintype d] [Nonempty d] :

                          There exists a ket for every nonempty d. Here, we use the uniform superposition

                          Equations
                          def Ket.basis {d : Type u_1} [Fintype d] (i : d) :
                          Ket d

                          Construct the Ket corresponding to a basis vector, with a +1 phase.

                          Equations
                          Instances For
                            def Bra.basis {d : Type u_1} [Fintype d] (i : d) :
                            Bra d

                            Construct the Bra corresponding to a basis vector, with a +1 phase.

                            Equations
                            Instances For
                              instance instFunLikeBraket {d : Type u_1} [Fintype d] :
                              FunLike (Bra d) (Ket d)

                              A Bra can be viewed as a function from Ket's to ℂ.

                              Equations
                              theorem Braket.dot_self_eq_one {d : Type u_1} [Fintype d] (ψ : Ket d) :
                              dot (↑ψ) ψ = 1

                              The inner product of any state with itself is 1.

                              def Ket.prod {d₁ : Type u_3} {d₂ : Type u_4} [Fintype d₁] [Fintype d₂] (ψ₁ : Ket d₁) (ψ₂ : Ket d₂) :
                              Ket (d₁ × d₂)

                              The outer product of two kets, creating an unentangled state.

                              Equations
                              • (ψ₁ψ₂) = { vec := fun (x : d₁ × d₂) => match x with | (i, j) => ψ₁ i * ψ₂ j, normalized' := }
                              Instances For
                                def Ket.IsProd {d₁ : Type u_3} {d₂ : Type u_4} [Fintype d₁] [Fintype d₂] (ψ : Ket (d₁ × d₂)) :

                                A Ket is a product if it's Ket.prod of two kets.

                                Equations
                                Instances For
                                  def Ket.IsEntangled {d₁ : Type u_3} {d₂ : Type u_4} [Fintype d₁] [Fintype d₂] (ψ : Ket (d₁ × d₂)) :

                                  A Ket is entangled if it's not Ket.prod of two kets.

                                  Equations
                                  Instances For
                                    @[simp]
                                    theorem Ket.IsProd_prod {d₁ : Type u_3} {d₂ : Type u_4} [Fintype d₁] [Fintype d₂] (ψ₁ : Ket d₁) (ψ₂ : Ket d₂) :
                                    (ψ₁ψ₂).IsProd

                                    Ket.prod states are product states.

                                    @[simp]
                                    theorem Ket.not_IsEntangled_prod {d₁ : Type u_3} {d₂ : Type u_4} [Fintype d₁] [Fintype d₂] (ψ₁ : Ket d₁) (ψ₂ : Ket d₂) :
                                    ¬(ψ₁ψ₂).IsEntangled

                                    Ket.prod states are not entangled states.

                                    theorem Ket.IsProd_iff_mul_eq_mul {d₁ : Type u_3} {d₂ : Type u_4} [Fintype d₁] [Fintype d₂] (ψ : Ket (d₁ × d₂)) :
                                    ψ.IsProd ∀ (i₁ i₂ : d₁) (j₁ j₂ : d₂), ψ (i₁, j₁) * ψ (i₂, j₂) = ψ (i₁, j₂) * ψ (i₂, j₁)

                                    A ket is a product state iff its components are cross-multiplicative.

                                    def Ket.MES (d : Type u_2) [Fintype d] [Nonempty d] :
                                    Ket (d × d)

                                    The Maximally Entangled State, or MES, on a d×d system. In principle there are many, this is specifically the MES with an all-positive phase. For instance on d := Fin 2, this is the Bell state

                                    Equations
                                    Instances For
                                      theorem Ket.MES_IsEntangled {d : Type u_1} [Fintype d] [Nontrivial d] :

                                      On any space of dimension at least two, the maximally entangled state MES is entangled.

                                      def Ket.PhaseEquiv {d : Type u_1} [Fintype d] :

                                      The equivalence relation on Ket where two kets equivalent if they are equal up to a global phase, i.e. `∃ z, ‖z‖ = 1 ∧ a.vec = z • b.vec

                                      Equations
                                      Instances For
                                        def KetUpToPhase (d : Type u_1) [Fintype d] :
                                        Type u_1

                                        The type of Kets up to a global phase equivalence, as given by Ket.PhaseEquiv. In particular, MStates really only care about a KetUpToPhase, and not Kets themselves.

                                        Equations
                                        Instances For