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 + 1

  • aleph (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}, where n = ceil(log2(M + 1)) and n_d = ceil(log2(N // 2 + M (M + 1) // 2)) + 1

  • mu_wires / nu_wires: the two index registers, exact

  • superposition_work_wires: the work register of SuperpositionTHC; its entry at index 3 is the one-body sentinel flag to pass as edge_flag

  • work_wires: the minimum auxiliary register of AliasSamplingTHC. Most of these wires retain data and are uncomputed by qp.adjoint(AliasSamplingTHC(...)). Additional wires are forwarded to the internal QROM, which uses them for a SelectSwap decomposition that lowers the T-gate count.

  • sign_wire: the index into work_wires of 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}

Contents

Using PennyLane

Release news

Development

API

Internals