qp.alias_sampling_thc_wires¶
- alias_sampling_thc_wires(M, N, aleph)[source]¶
Return the wire counts required by
AliasSamplingTHC.- Parameters:
M (int) – the THC rank
N (int) – the number of spin orbitals. Requires
N // 2 <= M + 1aleph (int) – the number of bits used to encode the keep-probabilities
- Returns:
{"mu_wires": n, "nu_wires": n, "superposition_work_wires": 3 * n + 5, "work_wires": n_d + 2 * n + 3 * aleph + 4 + max(n_d - aleph - 1, 0), "sign_wire": n_d}, wheren = ceil(log2(M + 1))andn_d = ceil(log2(N // 2 + M (M + 1) // 2)) + 1mu_wires/nu_wires: the two index registers, exactsuperposition_work_wires: the work register ofSuperpositionTHC; its entry at index3is the one-body sentinel flag to pass asedge_flagwork_wires: the minimum auxiliary register ofAliasSamplingTHC. Most of these wires retain data and are uncomputed byqp.adjoint(AliasSamplingTHC(...)). Additional wires are forwarded to the internalQROM, which uses them for aSelectSwapdecomposition that lowers the T-gate count.sign_wire: the index intowork_wiresof the wire holding the sign bit of the selected coefficient.
- Return type:
dict
Example
>>> qp.alias_sampling_thc_wires(M=2, N=2, aleph=6) {'mu_wires': 2, 'nu_wires': 2, 'superposition_work_wires': 11, 'work_wires': 29, 'sign_wire': 2}