Learning Home Catalog Composer
Learning
Home Catalog Composer
Tutorials

Compute dissociation curves for strong coupling systems with QunaSys QURI Chemistry

Usage estimate (NOTE: This is an estimate only. Your runtime may vary.)

  • 5 minutes QPU time on ibm_strasbourg
  • 2.5 minutes QPU time on ibm_torino

Background

Finding the ground state energy of molecules is a common step in material science, drug discovery and various other fields. Solving the ground state energy for strong coupling system in the dissociation process is particularly known to be difficult with classical methods such as Hartree-Fock (HF), CISD and CCSD. While FCI produces the exact ground state of the given Hamiltonain, diagonalizing the Hamiltonian using the full subspace basis vectors and is usually computationally costly. In this tutorial, you will learn how to use QURI Chemistry to produce the dissociation curve of N2N_2.

Requirements

Install the following dependencies to run the code in this tutorial.

Copy to clipboard

No output produced

Setup

To use QURI Chemistry, select the function via QiskitFunctionCatalog. You need an IBM Quantum Premium Plan account with a license from Qunasys to run this function.

Copy to clipboard

No output produced

Step 1: Map classical inputs to a quantum problem

Construct the molecule in json format. As an illustration, we assume the separation between the 2 nitrogen atoms to be 1 angstrom apart from each other.

Copy to clipboard

No output produced

Next, configure the QSCI algorithm by selecting the ansatz. Double excitation ansatz is recommended. CCSD parameter is used to prepare the ansatz.

Copy to clipboard

No output produced

Discretion is required to select the subspace size RR to run the QSCI algorithm. A space too small cannot capture enough important configurations. However, a space too large would correspond to FCI and the use of quantum computers become redundant. In the sto-3g basis, N2N_2 contains 10 spatial orbitals and 14 electrons. This thus maps to a 20-qubit problem. The FCI space contains 14400 basis vectors, so the selected subspace size should not approach this value. We choose half of this size as the subspace size for demonstration.

Copy to clipboard

No output produced

Copy to clipboard

Output:

{'ansatz': 'DoubleExcitation',
 'ansatz_setting': {'n_amplitudes': 20},
 'mole': {'atom': 'N 0 0 0; N 0 0 1.0'},
 'qsci_setting': {'n_shots': 100000, 'number_of_states_pick_out': 7200},
 'state_prep_method': 'CCSD'}

To improve the performance, it is recommended to turn on configuration recovery. For 20 qubit system with R=7200R = 7200, using the default confiugration recovery setting is sufficient.

Copy to clipboard

No output produced

Step 3: Execute using Qiskit Primitives

Now, pick the backend to submit the job to the function

Copy to clipboard

No output produced

Copy to clipboard

No output produced

FCI computation is still feasible at the scale of 20-qubit. We use PySCF to perform several classical computations and compare the energies against the QSCI energy.

Step 4: Compare with classical methods

Copy to clipboard

Output:

HF energy   : -107.4195 Ha, error:  129.77 mHa
CISD energy : -107.5414 Ha, error:  7.91 mHa
CCSD energy : -107.5467 Ha, error:  2.58 mHa
QSCI energy : -107.5492 Ha, error:  0.09 mHa
FCI energy  : -107.5493 Ha

You can see that QSCI is the only method that falls into the chemical accuracy region where energy error needs to be less than 1.6 mHa, and this is done by diagonalizing the subspace Hamiltonian half the size of the FCI space.

Producing the dissociation curve

As mentioned at the beginning of this tutorial, the non-triviality of our method is that it produces the whole N2N_2 dissociation curve with high accuracy. You can reuse the qsci input above with different distance settings.

Copy to clipboard

No output produced

With this function, we scan over d=0.7,1.0,1.5,2.0,2.4d = 0.7, 1.0, 1.5, 2.0, 2.4.

d = 0.7 angstrom

Copy to clipboard

No output produced

Copy to clipboard

Output:

HF energy   : -105.6974 Ha, error:  67.57 mHa
CISD energy : -105.7632 Ha, error:  1.76 mHa
CCSD energy : -105.7642 Ha, error:  0.75 mHa
QSCI energy : -105.7650 Ha, error:  0.01 mHa
FCI energy  : -105.7650 Ha

d = 1.5 angstrom

Copy to clipboard

No output produced

Copy to clipboard

Output:

HF energy   : -107.2724 Ha, error:  309.19 mHa
CISD energy : -107.5269 Ha, error:  54.69 mHa
CCSD energy : -107.5679 Ha, error:  13.78 mHa
QSCI energy : -107.5810 Ha, error:  0.66 mHa
FCI energy  : -107.5816 Ha

d = 2.0 angstrom

Copy to clipboard

No output produced

Copy to clipboard

Output:

HF energy   : -106.8715 Ha, error:  583.65 mHa
CISD energy : -107.2857 Ha, error:  169.48 mHa
CCSD energy : -107.5570 Ha, error: -101.83 mHa
QSCI energy : -107.4519 Ha, error:  3.21 mHa
FCI energy  : -107.4552 Ha

d = 2.4 angstrom

Copy to clipboard

No output produced

Copy to clipboard

Output:

HF energy   : -106.6566 Ha, error:  784.70 mHa
CISD energy : -107.1734 Ha, error:  267.94 mHa
CCSD energy : -107.0828 Ha, error:  358.53 mHa
QSCI energy : -107.4413 Ha, error:  0.01 mHa
FCI energy  : -107.4413 Ha

The dissociation curve

Finally, plot the QSCI energy against the classical methods: HF, CISD, CCSD, and FCI. You can see that all the QSCI points match well with the FCI values.

Copy to clipboard

No output produced

Copy to clipboard

Output:

Was this page helpful?