Skip to content

Commit

Permalink
fix doc in fermionic operators for molecule (#337)
Browse files Browse the repository at this point in the history
* fix doc in fermionic operators for molecule, now spin-orbital is specified
* add doc for spin-orbital order
  • Loading branch information
davibinco authored Mar 26, 2024
1 parent 423c8e7 commit a43ce8b
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/tequila/quantumchemistry/qc_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -647,23 +647,26 @@ def n_electrons(self) -> int:

def make_annihilation_op(self, orbital, coefficient=1.0):
"""
Compute annihilation operator on orbital=orbital in qubit representation
Compute annihilation operator on spin-orbital in qubit representation
Spin-orbital order is always (up,down,up,down,...)
"""
assert orbital<=self.n_orbitals*2
aop = openfermion.ops.FermionOperator(f'{orbital}', coefficient)
return self.transformation(aop)

def make_creation_op(self, orbital, coefficient=1.0):
"""
Compute creation operator on orbital=orbital in qubit representation
Compute creation operator on spin-orbital in qubit representation
Spin-orbital order is always (up,down,up,down,...)
"""
assert orbital<=self.n_orbitals*2
cop = openfermion.ops.FermionOperator(f'{orbital}^', coefficient)
return self.transformation(cop)

def make_number_op(self, orbital):
"""
Compute number operator on orbital=orbital in qubit representation
Compute number operator on spin-orbital in qubit representation
Spin-orbital order is always (up,down,up,down,...)
"""
num_op = self.make_creation_op(orbital) * self.make_annihilation_op(orbital)
return num_op
Expand Down

0 comments on commit a43ce8b

Please sign in to comment.