Quick start¶
This page cools one qubit with DBAC in a few lines, then explains what each line did. It
assumes dbac is installed.
Cool a qubit¶
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] # a qubit halfway between |0> and |1>
step = QITE_dme_select_M(M=1) # a DBAC step with one DME step
results = GCI(step, psi, None, [np.pi / 4, np.pi / 4]).execute_gci()
for k, F in enumerate(results[-1]):
print(f"after {k} DBAC steps: fidelity with |0> = {F:.3f}")
after 0 DBAC steps: fidelity with |0> = 0.500
after 1 DBAC steps: fidelity with |0> = 0.750
after 2 DBAC steps: fidelity with |0> = 0.875
The qubit started with a 50% overlap with the ground state \(|0\rangle\). Two DBAC steps raised that to 87.5%, without measuring the qubit or knowing its state.
What just happened¶
rx_sweep([0.5]) built the initial state \(\cos\theta|0\rangle - i\sin\theta|1\rangle\) with
\(\theta = 0.5 \cdot \pi/2\). It takes a list because it is usually used to sweep many angles at
once. → States and conventions
QITE_dme_select_M(M=1) created a step function: one round of cooling. A step rotates a
copy of the state and uses it as a quantum instruction, applied to the qubit through
density matrix exponentiation (DME) with \(M\) steps. → One DBAC step,
Density matrix exponentiation
GCI(step, psi, None, [s1, s2]) ran the step twice, with durations \(s_1 = s_2 = \pi/4\),
each time on the output of the previous step. execute_gci() returned a tuple of results;
results[-1] holds the fidelity after each step. → Running the recursion
Try changing¶
more DME steps:
QITE_dme_select_M(M=2)uses two instruction copies per step and cools more;more DBAC steps: a longer schedule
[np.pi / 4] * 4keeps cooling, with diminishing returns;a hotter state:
rx_sweep([0.9])starts closer to \(|1\rangle\). Note that \(|1\rangle\) itself (rx_sweep([1])) cannot be cooled at all: it is an excited eigenstate.
for M in (1, 2):
results = GCI(QITE_dme_select_M(M), psi, None, [np.pi / 4] * 4).execute_gci()
print(f"M = {M}:", np.round(results[-1], 3))
M = 1: [0.5 0.75 0.875 0.891 0.891]
M = 2: [0.5 0.802 0.917 0.925 0.926]
Next steps¶
The front page shows the same calculation for the paper’s three hardware circuits, next to the measured data.
The guide, starting with States and conventions, explains each module in depth.
Reproducing the figures lists the scripts that regenerate every figure of the paper.