API reference¶
The package has two halves: the physics in dbac, and the plotting in dbac.plotting. The
physics modules never import matplotlib.
If you are new to the package, the guide explains each module with runnable examples. These pages list every public function and its arguments.
module |
what it is for |
guide |
|---|---|---|
building initial states, fidelity, noise |
||
density matrix exponentiation, four implementations |
||
one DBAC step, the Hamiltonian |
||
running several steps, reading the results |
||
heat-bath algorithmic cooling, for comparison |
||
every figure: cooling curves, circuits, Bloch sphere, PTMs |
How the pieces fit together¶
A typical calculation touches the modules in this order:
dbac.utils.rx_sweepbuilds the initial states;dbac.dbqite.QITE_dme_select_Mmakes a DBAC step function, which uses DME internally;dbac.gci.GCIruns that step \(k\) times and records energy and fidelity;dbac.plottingdraws the result.
import numpy as np
from dbac.utils import rx_sweep
from dbac.dbqite import QITE_dme_select_M
from dbac.gci import GCI
psi = rx_sweep([0.5])[0] # 1. initial state
step = QITE_dme_select_M(1) # 2. step with M = 1
results = GCI(step, psi, None, [np.pi / 4] * 2).execute_gci() # 3. k = 2 steps
print(results[-1]) # fidelity after 0, 1, 2 steps