Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor bug fix #79

Merged
merged 2 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading