Skip to main content

Code

All the code used to calculate \displaystyle \mathcal{D}_{\mathcal{F}} from an entanglement spectrum or energy spectrum can be found on Bitbucket. The git repository assumes an installation of Anaconda is present and contains the essential packages for calculating \mathcal{D}_{\mathcal{F}} in esfactor/packages/esfactor/. Included in esfactor/notebooks/tests/ is a Jupyter notebook that has an example of how you should use the package. This is the best way to play around with the code, but it is recommended that you have a good understanding of the underlying physics beforehand.

The main function that is used to calculate \mathcal{D}_{\mathcal{F}}, as well as the factorisation (number of free particles used to model the system) and single-body energies, is the minimise(...) function. There are two example uses of this code in the probabilities.ipynb notebook, the first is using an entanglement energy spectrum (hence the -np.log(entanglement_spectrum)), the second is using just the probability spectrum (eigenvalues of the reduced density matrix). Note the differences in the other function arguments, such as TraceD_p rather than TraceD and ansatz=FermionProbabilityAnsatz() rather than ansatz=FermionAnsatz(). Using the correct arguments with the data that you are providing is essential to getting the correct values of \mathcal{D}_{\mathcal{F}}, factorisation and single-body energies.

As shown in the Ising Model section of this site, the function outputs various parameters relating to the derived quantity as follows:
{ 'N': (100, 23570),
'T': 14.219000101089478,
'ansatz': 'FermionAnsatz',
'converged': True,
'cost': 1.1464786792656745e-16,
'ftol': 1e-06,
'hopping': True,
'm_k': array([ 2.19214288, 8.51959828, 18.19415824]),
'method': 'Nelder-Mead',
'normed': True,
'qm': None,
'qz': None,
'xtol': None,
'z': 0.10606936111744662 }

The important parts are again bolded, namely the cost and m_k, which are the values for \mathcal{D}_{\mathcal{F}} and the single body energies respectively.
If the approximation is a good one, the value for \mathcal{D}_{\mathcal{F}} should be very small (of order 10^{-14}) and the energy spectrum constructed using the single body energies should be similar to the energy spectrum of the approximated model. Note that the energy spectrum constructed from the single body energies will always appear free, as it is assumed to be free during the calculation.

Other Parameters

The minimise(...) function takes various parameters other than just the entanglement spectrum. Below is a list of these parameters and what they do/how they should be used:

  • cost_func: The cost function for the approximation - esfactor.cost.TraceD for dealing with energy spectra, esfactor.cost.TraceD_p for dealing with probability spectra.
  • xi_k: The spectra to be approximated - Ensure that the other arguments are chosen appropriately depending on the type of spectrum (energy or probability).
  • ansatz: The function to use to calculate an initial parameter guess - esfactor.ansatz.FermionAnsatz() for dealing with energy spectra, esfactor.code.FermionProbabilityAnsatz() for dealing with with probability spectra.
  • hopping: Determines whether to 'hop' through parameter space in order to sample a larger area, or just do a single gradient descent minimisation - True to enable, False to disable.
  • normed: Whether or not the input spectrum is normalised (if using an energy spectrum, whether the underlying probability spectrum is normalised) - True if normalised, False if not.
  • temperature: Experimental parameter that effects the hopping through parameter space - default value = 5.0

A brief description of how the optimal spectrum is found

In the context of an optimisation procedure, the cost function is D(\rho, \sigma) = \frac{1}{2}\mathrm{tr}\sqrt{(\rho - \sigma)^2}, which shall be minimised with the spectrum of the free density matrix, \sigma being the variational parameters. The first step is to make an ansatz about the emergent quasiparticles. This is necessary as in general systems that comprise quasiparticles with different mutual statistics have Hilbert spaces of unequal dimension, and in order to find an optimal free description in terms of these particles with different statistics we must express the state in a Hilbert space with different dimension. Luckily the Schmidt decomposition allows to pad our state with zeroes without changing correlations in |\psi\rangle.

For each pixel of these graphs esfactor was used to calculate [latex]D_\mathcal{F}[/latex]

The esfactor library then can have the interacting spectrum passed to it to begin mapping out D(\rho, \sigma) space. Abstractly: the minimisation starts with an initial guess vector of \sigma which depends on the ansatz being used (more details on this are given in the Methods section of the first paper). The global minimum D_\mathcal{F} is assumed to exist surrounded by clusters of local minima, which are in turn assumed to exist surrounded by less 'deep' local minima. This assumption is codified by a basin-hopping algorithm which will always allow some probability of escaping a minimum in order to measure how likely it is to be local (Metropolis Monte-Carlo). After each hopping step the Nelder-Mead method is used to find the minimum of the basin. Throughout this entire process an algorithm is analysing which parts of the optimal spectrum are large enough to be discarded, which can be understood through the expression for interaction distance in terms of the optimal spectrum \{\epsilon\}.

\displaystyle  D_\mathcal{F} (\rho) = \underset{\{\epsilon\}}{\mathrm{min}}\ \frac{1}{2} \sum_{k}^{} \left| e^{-E_k} - e^{-E^{f}_{k}(\{\epsilon\})} \right|

Therefore each contribution to D_\mathcal{F} from the optimum spectrum decays exponentially with the size of the entanglement energy.