uniqc.algorithms.core.circuits.thermal_state module¶
Thermal state preparation circuit fragment.
- uniqc.algorithms.core.circuits.thermal_state.thermal_state_circuit(first_arg=None, beta=1.0, qubits=None)[source]¶
Build (or apply) a thermal-state preparation fragment for \(H=\sum_i Z_i\).
Two calling conventions:
# Fragment style (recommended): c = thermal_state_circuit(3, beta=1.0) # returns Circuit # Legacy in-place style (deprecated): c = Circuit(3) thermal_state_circuit(c, beta=1.0) # mutates c in place
Each qubit is prepared in \(\sqrt{p_0}|0\rangle + \sqrt{p_1}|1\rangle\) with \(p_0 = e^\beta / (e^\beta + e^{-\beta})\).