openfermion.transforms.FenwickTree

Recursive implementation of the Fenwick tree.

Please see Subsection B.2. of Operator Locality in Quantum Simulation of Fermionic Models (arXiv:1701.07072) for a reference to the update set (U), the parity set (P) and the children set (F) sets of the Fenwick.

n_qubits Int, the number of qubits in the system

Methods

get_children_set

View source

Returns the set of children of j-th site.

Args
j (int): Fermionic site index.

Returns
A list of children of j. ordered from lowest index.

get_node

View source

Returns the node at j in the qubit register. Wrapper.

Args
j (int): Fermionic site index.

Returns
FenwickNode the node at j.

get_parity_set

View source

Returns the union of the remainder set with children set. Coincides with the parity set of Tranter et al.

Args
j (int): Fermionic site index.

Returns
A C union F

get_remainder_set

View source

Return the set of children with indices less than j of all ancestors of j. The set C from (arXiv:1701.07072).

Args
j (int): Fermionic site index.

Returns
A list of children of j-ancestors with index less than j.

get_update_set

View source

The set of all ancestors of j, (the update set U from the paper).

Args
j (int): Fermionic site index.

Returns
List of ancestors of j, ordered from earliest.

root None