dbac.hbac¶
Heat-bath algorithmic cooling (HBAC), the standard entropy-based protocol, implemented
minimally so DBAC can be compared with it. Each round resets the last qubit to a thermal state
and sorts the populations of the joint state; hbac runs several rounds and returns the first
qubit.
See HBAC baseline for how HBAC differs from DBAC and a side-by-side comparison.
|
Run step rounds of heat-bath algorithmic cooling (reset + compress) on rho, then trace out every qubit except the first (the target qubit, which the sorting step cools). |
|
Reset the last qubit of a joint density matrix to a thermal state with polarization epsilon_b, by rescaling each 2x2 block of rho that acts on that qubit. |
Sort-and-compress step of HBAC: reorder the populations of rho in descending order, discarding coherences, to approximate the state achievable by the optimal (sorting) unitary. |
Running HBAC¶
- hbac(rho, epsilon_b=0.8, step=1)[source]¶
Run step rounds of heat-bath algorithmic cooling (reset + compress) on rho, then trace out every qubit except the first (the target qubit, which the sorting step cools).
- Parameters:
- Returns:
2x2 reduced density matrix of the first qubit.
- Return type:
ndarray
Example
>>> import numpy as np >>> from dbac.hbac import hbac >>> mixed = np.eye(2) / 2 # maximally mixed qubit >>> rho = np.kron(np.kron(mixed, mixed), mixed) >>> hbac(rho, epsilon_b=0.8, step=6).real.round(3) array([[0.985, 0. ], [0. , 0.015]])
The two parts of a round¶
- refresh_reset_qubit(rho, epsilon_b)[source]¶
Reset the last qubit of a joint density matrix to a thermal state with polarization epsilon_b, by rescaling each 2x2 block of rho that acts on that qubit.
- Parameters:
rho (ndarray) – 2^n x 2^n density matrix of n qubits.
epsilon_b (float) – Polarization of the reset qubit.
- Returns:
New density matrix after resetting the last qubit.
- Return type:
ndarray
- compress_density_matrix(rho)[source]¶
Sort-and-compress step of HBAC: reorder the populations of rho in descending order, discarding coherences, to approximate the state achievable by the optimal (sorting) unitary.
- Parameters:
rho (ndarray) – Density matrix (Hermitian, positive semidefinite, trace 1).
- Returns:
Diagonal density matrix with sorted probabilities.
- Return type:
ndarray