PhysLean Documentation

PhysLean.StatisticalMechanics.CanonicalEnsemble.Basic

Canonical ensemble #

A canonical ensemble describes a system in thermal equilibrium with a heat bath at a fixed temperature.

In this file we define the canonical ensemble, its partition function, the probability of being in a given microstate, the mean energy, the entropy and the Helmholtz free energy.

We also define the addition of two canonical ensembles, and prove results related to the properties of additions of canonical ensembles.

## References

A Canonical ensemble is described by a type ι, corresponding to the type of microstates, and a map ι → ℝ which associates which each microstate an energy.

Equations
Instances For

    The addition of two CanonicalEnsemble.

    Equations
    def CanonicalEnsemble.nsmul {ι : Type} (n : ) (𝓒1 : CanonicalEnsemble ι) :

    Scalar multiplication of CanonicalEnsemble, defined such that nsmul n 𝓒 is n coppies of the canonical ensemble 𝓒.

    Equations
    Instances For
      @[reducible, inline]

      The microstates of a the canonical ensemble

      Equations
      Instances For

        The energy of the microstates #

        @[reducible, inline]
        abbrev CanonicalEnsemble.energy {ι : Type} (𝓒 : CanonicalEnsemble ι) :
        𝓒.microstates

        The energy of associated with a mircrostate of the canonical ensemble.

        Equations
        Instances For
          @[simp]
          theorem CanonicalEnsemble.energy_add_apply {ι ι1 : Type} (𝓒 : CanonicalEnsemble ι) (𝓒1 : CanonicalEnsemble ι1) (i : (𝓒 + 𝓒1).microstates) :
          (𝓒 + 𝓒1).energy i = 𝓒.energy i.1 + 𝓒1.energy i.2
          @[simp]
          theorem CanonicalEnsemble.energy_nsmul_apply {ι : Type} (𝓒 : CanonicalEnsemble ι) (n : ) (f : Fin n𝓒.microstates) :
          (nsmul n 𝓒).energy f = i : Fin n, 𝓒.energy (f i)

          The partition function of the canonical ensemble #

          noncomputable def CanonicalEnsemble.partitionFunction {ι : Type} (𝓒 : CanonicalEnsemble ι) [Fintype ι] (T : Temperature) :

          The partition function of the canonical ensemble.

          Equations
          Instances For
            noncomputable def CanonicalEnsemble.partitionFunctionβ {ι : Type} (𝓒 : CanonicalEnsemble ι) [Fintype ι] (β : ) :

            The partition function of the canonical ensemble as a function of β

            Equations
            Instances For
              theorem CanonicalEnsemble.partitionFunctionβ_def {ι : Type} (𝓒 : CanonicalEnsemble ι) [Fintype ι] :
              𝓒.partitionFunctionβ = fun (β : ) => i : 𝓒.microstates, Real.exp (-β * 𝓒.energy i)

              The probability of being in a given microstate #

              noncomputable def CanonicalEnsemble.probability {ι : Type} (𝓒 : CanonicalEnsemble ι) [Fintype ι] (i : 𝓒.microstates) (T : Temperature) :

              The probability of been in a given microstate.

              Equations
              Instances For
                @[simp]
                theorem CanonicalEnsemble.probability_add {ι ι1 : Type} (𝓒 : CanonicalEnsemble ι) (𝓒1 : CanonicalEnsemble ι1) [Fintype ι] [Fintype ι1] (i : (𝓒 + 𝓒1).microstates) (T : Temperature) :
                (𝓒 + 𝓒1).probability i T = 𝓒.probability i.1 T * 𝓒1.probability i.2 T
                @[simp]
                theorem CanonicalEnsemble.sum_probability_eq_one {ι : Type} (𝓒 : CanonicalEnsemble ι) [Fintype ι] [Nonempty ι] (T : Temperature) :
                i : 𝓒.microstates, 𝓒.probability i T = 1

                The mean energy of the canonical ensemble #

                noncomputable def CanonicalEnsemble.meanEnergy {ι : Type} (𝓒 : CanonicalEnsemble ι) [Fintype ι] (T : Temperature) :

                The mean energy of the canonical ensemble.

                Equations
                Instances For
                  @[simp]
                  theorem CanonicalEnsemble.meanEnergy_add {ι ι1 : Type} (𝓒 : CanonicalEnsemble ι) [Fintype ι] [Nonempty ι] (𝓒1 : CanonicalEnsemble ι1) [Fintype ι1] [Nonempty ι1] (T : Temperature) :
                  (𝓒 + 𝓒1).meanEnergy T = 𝓒.meanEnergy T + 𝓒1.meanEnergy T

                  Entropy #

                  noncomputable def CanonicalEnsemble.entropy {ι : Type} (𝓒 : CanonicalEnsemble ι) [Fintype ι] (T : Temperature) :

                  The entropy of the canonical ensemble.

                  Equations
                  Instances For
                    @[simp]
                    theorem CanonicalEnsemble.entropy_add {ι ι1 : Type} (𝓒 : CanonicalEnsemble ι) [Fintype ι] [Nonempty ι] (𝓒1 : CanonicalEnsemble ι1) [Fintype ι1] [Nonempty ι1] (T : Temperature) :
                    (𝓒 + 𝓒1).entropy T = 𝓒.entropy T + 𝓒1.entropy T

                    Entropy is addative on adding canonical ensembles.

                    Helmholtz free energy #

                    noncomputable def CanonicalEnsemble.helmholtzFreeEnergy {ι : Type} (𝓒 : CanonicalEnsemble ι) [Fintype ι] (T : Temperature) :

                    The (Helmholtz) free energy of the canonical ensemble.

                    Equations
                    Instances For
                      @[simp]

                      The Helmholtz free energy is addative.