Skip to content

Commit

Permalink
release notes: added example
Browse files Browse the repository at this point in the history
  • Loading branch information
grossardt committed Feb 25, 2024
1 parent 9409137 commit 42face7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions releasenotes/notes/add-majoranaop-1cbf9d4a1d4c264e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ features:
- |
Adds a new operator class, :class:`~qiskit_nature.second_q.operators.MajoranaOp`
to handle operators that are sums of tensor products of Majorana fermion operators.
This is needed for the implementation of the Ternary Tree Mapper, but might be useful
later on for other purposes as well.
Majorana operators use a string representation with underscore only, e.g. ``'_0 _1'``
corresponds to :math:`\gamma_0 \gamma_1` where there are twice the number of spin orbitals
Expand All @@ -13,4 +11,10 @@ features:
Methods of :class:`~qiskit_nature.second_q.operators.MajoranaOp` follow the same API as for
:class:`~qiskit_nature.second_q.operators.FermionicOp` except for normal ordering, which is
unnecessary. A Majorana operator can be created from a Fermionic operator using the
:meth:`~qiskit_nature.second_q.operators.MajoranaOp.from_fermionic_op` class method.
:meth:`~qiskit_nature.second_q.operators.MajoranaOp.from_fermionic_op` class method. E.g.:
.. code-block:: python
from qiskit_nature.second_q.operators import FermionicOp, MajoranaOp
f_op = FermionicOp({"+_0 -_1": 1}, num_spin_orbitals=2)
m_op = MajoranaOp.from_fermionic_op(f_op)

0 comments on commit 42face7

Please sign in to comment.