A verifiable quantum advantage towards real world applications: Quantum Echoes 
Learn more
         
     
  
  
  
  
  
    
      openfermion.transforms.FenwickTree
  
      
    
  
  
  
  
  
    
  
  
    
    
Recursive implementation of the Fenwick tree.
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.
| Args | 
|---|
| n_qubits | Int, the number of qubits in the system | 
Methods
get_children_set
View source
get_children_set(
    j
)
Returns the set of children of j-th site.
| Args | 
|---|
| j | intFermionic site index.
 | 
| Returns | 
|---|
| A list of children of j. ordered from lowest index. | 
get_node
View source
get_node(
    j
)
Returns the node at j in the qubit register. Wrapper.
| Args | 
|---|
| j | intFermionic site index.
 | 
| Returns | 
|---|
| FenwickNode | the node at j. | 
get_parity_set
View source
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 | intFermionic site index.
 | 
get_remainder_set
View source
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 | intFermionic site index.
 | 
| Returns | 
|---|
| A list of children of j-ancestors with index less than j. | 
get_update_set
View source
get_update_set(
    j
)
The set of all ancestors of j, (the update set U from the paper).
| Args | 
|---|
| j | intFermionic site index.
 | 
| Returns | 
|---|
| List of ancestors of j, ordered from earliest. | 
| Class Variables | 
|---|
| root | None | 
  
  
 
  
    
    
      
    
    
  
       
    
    
  
  
  Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
  Last updated 2025-06-06 UTC.
  
  
  
    
      [[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-06-06 UTC."],[],[]]