monte_carlo module

Simple Monte Carlo routines for evaluating in the canonical ensemble.

monte_carlo.create_orb_list(probs, ne)

Create orbital list with \(N\) electrons

Parameters:
  • probs (list) – Single particle probabilities (fermi factors).
  • ne (int) – Number of electrons.
Returns:

  • gen (boolean) – True if configuration with ne electrons was generated.
  • selected_orbs (list) – Selected orbitals.

monte_carlo.gc_correction_free_energy(sys, cpot, beta, delta, delta_error)
Canonical correction to free electron grand canonical partition function.

Assumption, \(Z_{GC}(N) / Z_{GC} = \delta\), so

\[-kT \log\delta = -kT \log Z_{GC}(N) + kT \log Z_{GC}.\]

Therefore,

\[-kT \log Z_N = -kT \log \delta - kT \log Z_{GC} + \mu N,\]

or

\[F^0_N = \Omega + \Delta(N) + \mu N.\]
Parameters:
  • sys (class) – System being studied.
  • mu (float) – Chemical potential.
  • beta (float) – Inverse temperature.
  • delta (float) – naccept/ntotal.
  • delta_error (float) – standard error in delta.
Returns:

F_N – Canonical free electron Helmholtz free energy.

Return type:

float

monte_carlo.sample_canonical_energy(system, beta, nmeasure)

Sample canonical energy of a non-interacting system.

Properties of the non-interacting canonical system can be evaluated by simply discarding configurations generated in grand canonical ensemble whose particle number is not equal to the expected number of particles.
Parameters:
  • system (class) – System being studied.
  • beta (float) – Inverse temperature.
  • nmeasure (int) – Number of attempted Monte Carlo moves.
Returns:

frame – Frame containing estimates for properties of system at temperature theta.

Return type:

pandas.DataFrame