Skip to content

Commit

Permalink
added docstring for qeb and updated doc/api-reference
Browse files Browse the repository at this point in the history
  • Loading branch information
damarkian committed Sep 3, 2024
1 parent d244ea6 commit e52f90a
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
3 changes: 3 additions & 0 deletions doc/source/api-reference/ansatz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Unitary Coupled Cluster

.. autofunction:: qibochem.ansatz.ucc.ucc_ansatz

.. autofunction:: qibochem.ansatz.qeb.qeb_circuit


Basis rotation
--------------

Expand Down
17 changes: 17 additions & 0 deletions src/qibochem/ansatz/qeb.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@
from qibo import Circuit, models, gates

def qeb_circuit(n_qubits, excitation, theta=0.0, trotter_steps=1) -> Circuit:
r"""
Qubit-excitation-based (QEB) circuit corresponding to the unitary coupled-cluster ansatz for a single excitation
Supports only Jordan-Wigner encoded circuits
Ref: arXiv:2210.05771
Args:
n_qubits: Number of qubits in the quantum circuit
excitation: Iterable of orbitals involved in the excitation; must have an even number of elements
E.g. ``[0, 1, 2, 3]`` represents the excitation of electrons in orbitals ``(0, 1)`` to ``(2, 3)``
theta: UCC parameter. Defaults to 0.0
trotter_steps: Number of Trotter steps; i.e. number of times this ansatz is applied with ``theta`` = ``theta / trotter_steps``. Default: 1
Returns:
Qibo ``Circuit``: Circuit corresponding to a single UCC excitation
"""

n_orbitals = len(excitation)
assert n_orbitals % 2 == 0, f"{excitation} must have an even number of items"
Expand Down

0 comments on commit e52f90a

Please sign in to comment.