Recursive implementation of the Fenwick tree.
View aliases
Main aliases
openfermion.FenwickTree
, openfermion.transforms.opconversions.FenwickTree
, openfermion.transforms.opconversions.fenwick_tree.FenwickTree
openfermion.transforms.FenwickTree(
n_qubits
)
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.
Methods
get_children_set
get_children_set(
j
)
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
get_node(
j
)
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
get_parity_set(
j
)
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
get_remainder_set(
j
)
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
get_update_set(
j
)
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. |