Module: openfermion.transforms


opconversions module

repconversions module


class FenwickNode: Fenwick Tree node.

class FenwickTree: Recursive implementation of the Fenwick tree.

class StabilizerError: Stabilizer error class.


binary_code_transform(...): Transforms a Hamiltonian written in fermionic basis into a Hamiltonian written in qubit basis, via a binary code.

bravyi_kitaev(...): Apply the Bravyi-Kitaev transform.

bravyi_kitaev_code(...): The Bravyi-Kitaev transform as binary code.

bravyi_kitaev_fast(...): Find the Pauli-representation of InteractionOperator for Bravyi-Kitaev Super fast (BKSF) algorithm.

bravyi_kitaev_fast_edge_matrix(...): Use InteractionOperator to construct edge matrix required for the algorithm

bravyi_kitaev_fast_interaction_op(...): Transform from InteractionOperator to QubitOperator for Bravyi-Kitaev fast algorithm.

bravyi_kitaev_tree(...): Apply the "tree" Bravyi-Kitaev transform.

check_commuting_stabilizers(...): Auxiliary function checking that stabilizers commute.

check_no_sympy(...): Checks whether a SymbolicOperator contains any sympy expressions, which will prevent it being converted to a PolynomialTensor or DiagonalCoulombHamiltonian

check_stabilizer_linearity(...): Auxiliary function checking that stabilizers are linearly independent.

checksum_code(...): Checksum code for either even or odd Hamming weight.

chemist_ordered(...): Puts a two-body fermion operator in chemist ordering.

commutator_ordered_diagonal_coulomb_with_two_body_operator(...): Compute the commutator of two-body operators provided that both are normal-ordered and that the first only has diagonal Coulomb interactions.

fix_single_term(...): Auxiliary function for term reductions.

fourier_transform(...): Apply Fourier transform to change hamiltonian in plane wave basis.

freeze_orbitals(...): Fix some orbitals to be occupied and others unoccupied.

get_boson_operator(...): Convert to BosonOperator.

get_diagonal_coulomb_hamiltonian(...): Convert a FermionOperator to a DiagonalCoulombHamiltonian.

get_fermion_operator(...): Convert to FermionOperator.

get_interaction_operator(...): Convert a 2-body fermionic operator to InteractionOperator.

get_majorana_operator(...): Convert to MajoranaOperator.

get_molecular_data(...): Output a MolecularData object generated from an InteractionOperator

get_quad_operator(...): Convert to QuadOperator.

get_quadratic_hamiltonian(...): Convert a quadratic fermionic operator to QuadraticHamiltonian.

interleaved_code(...): Linear code that reorders orbitals from even-odd to up-then-down.

inverse_fourier_transform(...): Apply inverse Fourier transform to change hamiltonian in plane wave dual basis.

jordan_wigner(...): Apply the Jordan-Wigner transform to a FermionOperator, InteractionOperator, or DiagonalCoulombHamiltonian to convert to a QubitOperator.

jordan_wigner_code(...): The Jordan-Wigner transform as binary code.

jordan_wigner_one_body(...): Map the term a^\dagger_p a_q + h.c. to QubitOperator.

jordan_wigner_two_body(...): Map the term a^\dagger_p a^\dagger_q a_r a_s + h.c. to QubitOperator.

linearize_decoder(...): Outputs linear decoding function from input matrix

mccoy(...): Implement the McCoy formula on two operators of the form op_a^m op_b^n.

normal_ordered(...): Compute and return the normal ordered form of a FermionOperator, BosonOperator, QuadOperator, or InteractionOperator.

normal_ordered_ladder_term(...): Return a normal ordered FermionOperator or BosonOperator corresponding to single term.

normal_ordered_quad_term(...): Return a normal ordered QuadOperator corresponding to single term.

parity_code(...): The parity transform (arXiv:1208.5986) as binary code.

project_onto_sector(...): Remove qubit by projecting onto sector.

projection_error(...): Calculate the error from the project_onto_sector function.

prune_unused_indices(...): Remove indices that do not appear in any terms.

qubit_operator_to_pauli_sum(...): Convert QubitOperator to a sum of PauliString.

reduce_number_of_terms(...): Reduce the number of Pauli strings of operator using stabilizers.

reorder(...): Changes the ladder operator order of the Hamiltonian based on the provided order_function per mode index.

reverse_jordan_wigner(...): Transforms a QubitOperator into a FermionOperator using the Jordan-Wigner transform.

rotate_qubit_by_pauli(...): Rotate qubit operator by exponential of Pauli.

symmetric_ordering(...): Apply the symmetric ordering to a BosonOperator or QuadOperator.

symmetry_conserving_bravyi_kitaev(...): Returns the qubit Hamiltonian for the fermionic Hamiltonian supplied, with two qubits removed using conservation of electron spin and number, as described in arXiv:1701.08213.

taper_off_qubits(...): Remove qubits from given operator.

verstraete_cirac_2d_square(...): Apply the Verstraete-Cirac transform on a 2-d square lattice.

vertical_edges_snake(...): Obtain the vertical edges in the 2-d snake ordering.

weight_one_binary_addressing_code(...): Weight-1 binary addressing code (arXiv:1712.07067).

weight_one_segment_code(...): Weight-1 segment code (arXiv:1712.07067).

weight_two_segment_code(...): Weight-2 segment code (arXiv:1712.07067).

weyl_polynomial_quantization(...): Apply the Weyl quantization to a phase space polynomial.