SupportsFermionOperator¶
- class SupportsFermionOperator(*args, **kwargs)¶
Bases:
ProtocolAn equivalent of the
ffsim.SupportsFermionOperatorprotocol.See
fermion_operator()for the type-agnostic helper function dispatching to the method below.>>> from qiskit_fermions.operators import MajoranaOperator >>> maj_op = MajoranaOperator.from_dict({(0, 1): 1}) >>> fer_op = maj_op._fermion_operator_() >>> print(format(fer_op.normal_ordered().simplify())) 0.000000e0 +1.000000e0j * () 0.000000e0 -2.000000e0j * (+0 -0)
Protocol Methods
- _fermion_operator_()¶
Converts this operator into a
FermionOperatorinstance.- Return type: