qp.one_body_block_encoding_wires

one_body_block_encoding_wires(norbs, alias_sampling_nbits)[source]

Returns the sizes of the three wire registers required by OneBodyBlockEncoding.

OneBodyBlockEncoding acts on three disjoint registers whose sizes are fixed by norbs and alias_sampling_nbits. Use this function to size them before allocating wires.

The registers are:
  • prep_wires: the PREP register whose \(|\vec 0\rangle\) block holds the encoded operator, \(2 \lceil \log_2 n_\text{orbs} \rceil + 3 \mu + 1\) wires

  • system_wires: the state register \(|\psi\rangle\) the operator acts on, \(2 n_\text{orbs}\) wires

  • work_wires: clean work wires that start and end in \(|0\rangle\), at least \(\lceil \log_2 n_\text{orbs} \rceil\) of them

Here \(\mu\) is alias_sampling_nbits.

Parameters:
  • norbs (int) – number of spatial orbitals

  • alias_sampling_nbits (int) – number of bits of precision used for the alias-sampling coefficients

Returns:

the required number of wires for prep_wires and system_wires, which are exact, and the minimum number for work_wires

Return type:

dict[str, int]

Example

>>> qp.one_body_block_encoding_wires(4, alias_sampling_nbits=2)
{'prep_wires': 11, 'system_wires': 8, 'work_wires': 2}

Contents

Using PennyLane

Release news

Development

API

Internals