Skip to content

Commit

Permalink
Merge pull request #79 from qiboteam/bug-fix
Browse files Browse the repository at this point in the history
Minor bug fix
  • Loading branch information
damarkian authored Feb 10, 2024
2 parents 6eaca8a + 79f7f00 commit cc54974
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion doc/source/getting-started/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Here is an example of building the UCCD ansatz with the H2 molecule to test your
hamiltonian = h2.hamiltonian()

# Build a UCC circuit ansatz for running VQE
circuit = hf_circuit(h2.nso, sum(h2.nelec))
circuit = hf_circuit(h2.nso, h2.nelec)
circuit += ucc_circuit(h2.nso, [0, 1, 2, 3])

# Create and run the VQE, starting with random initial parameters
Expand Down
2 changes: 1 addition & 1 deletion doc/source/tutorials/ansatz.rst
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ An example of how to build a UCC doubles circuit ansatz for the :math:`H_2` mole
# Set parameters for the rest of the experiment
n_qubits = mol.nso
n_electrons = mol.nalpha + mol.nbeta
n_electrons = mol.nelec
# Build UCCD circuit
circuit = hf_circuit(n_qubits, n_electrons) # Start with HF circuit
Expand Down
2 changes: 1 addition & 1 deletion src/qibochem/ansatz/ucc.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ def ucc_ansatz(
Qibo ``Circuit``: Circuit corresponding to an UCC ansatz
"""
# Get the number of electrons and spin-orbitals from the molecule argument
n_elec = sum(molecule.nelec) if molecule.n_active_e is None else molecule.n_active_e
n_elec = molecule.nelec if molecule.n_active_e is None else molecule.n_active_e
n_orbs = molecule.nso if molecule.n_active_orbs is None else molecule.n_active_orbs

# Define the excitation level to be used if no excitations given
Expand Down

0 comments on commit cc54974

Please sign in to comment.