SupportsMajoranaOperator¶
- class SupportsMajoranaOperator(*args, **kwargs)¶
Bases:
ProtocolAn equivalent of the
SupportsFermionOperatorprotocol, targeting Majorana operators.See
majorana_operator()for the type-agnostic helper function dispatching to the method below.>>> from qiskit_fermions.operators import FermionOperator >>> fer_op = FermionOperator.from_dict({((True, 0), (False, 0)): 1}) >>> maj_op = fer_op._majorana_operator_() >>> print(format(maj_op.normal_ordered().simplify())) 5.000000e-1 +0.000000e0j * () 0.000000e0-5.000000e-1j * (γ'0 γ0)
Protocol Methods
- _majorana_operator_()¶
Converts this operator into a
MajoranaOperatorinstance.- Return type: