From 2eccad15d50201012af2b7e0ccdf912f03f2c6f5 Mon Sep 17 00:00:00 2001 From: Wong Zi Cheng <70616433+chmwzc@users.noreply.github.com> Date: Tue, 6 Feb 2024 01:33:08 +0000 Subject: [PATCH 1/2] Minor bug fix Came about due to working on the ucc_ansatz and mol-updates branches separately --- src/qibochem/ansatz/ucc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/qibochem/ansatz/ucc.py b/src/qibochem/ansatz/ucc.py index a234c1b..9888be1 100644 --- a/src/qibochem/ansatz/ucc.py +++ b/src/qibochem/ansatz/ucc.py @@ -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 From 79f7f005d8582b9972885ec53200a07d92b3df42 Mon Sep 17 00:00:00 2001 From: chmwzc <70616433+chmwzc@users.noreply.github.com> Date: Fri, 9 Feb 2024 18:13:54 +0800 Subject: [PATCH 2/2] Update docs --- doc/source/getting-started/quickstart.rst | 2 +- doc/source/tutorials/ansatz.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/getting-started/quickstart.rst b/doc/source/getting-started/quickstart.rst index 6d491cd..a2ed28d 100644 --- a/doc/source/getting-started/quickstart.rst +++ b/doc/source/getting-started/quickstart.rst @@ -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 diff --git a/doc/source/tutorials/ansatz.rst b/doc/source/tutorials/ansatz.rst index ae3ff31..09b76e2 100644 --- a/doc/source/tutorials/ansatz.rst +++ b/doc/source/tutorials/ansatz.rst @@ -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