নোট

এই পৃষ্ঠাটি docs/tutorials/01_electronic_structure.ipynb থেকে বানানো হয়েছে।

ইলেকট্রনিক গঠন#

ভূমিকা#

মলিকুলার বা আণবিক হ্যামিল্টোনিয়ান হলো

\[\mathcal{H} = - \sum_I \frac{\nabla_{R_I}^2}{M_I} - \sum_i \frac{\nabla_{r_i}^2}{m_e} - \sum_I\sum_i \frac{Z_I e^2}{|R_I-r_i|} + \sum_i \sum_{j>i} \frac{e^2}{|r_i-r_j|} + \sum_I\sum_{J>I} \frac{Z_I Z_J e^2}{|R_I-R_J|}\]

যেহেতু ইলেকট্রনের চেয়ে নিউক্লিয়াস বা কেন্দ্র বেশি ভারী, তাই তারা একই সময় স্কেলে স্থানপরিবর্তন করে না। তাই নিউক্লিয়াস এবং ইলেকট্রনের ধর্মকে ডিকাপ্লিং বা পৃথক করা যায়। এটি হল বর্ন-ওপেনহাইমার অনুমান।

Therefore, one can first tackle the electronic problem with the nuclear coordinates entering only as parameters. The energy levels of the electrons in the molecule can then be found by solving the non-relativistic time independent Schrödinger equation,

\[\mathcal{H}_{\text{el}} |\Psi_{n}\rangle = E_{n} |\Psi_{n}\rangle\]

যেখানে

\[\mathcal{H}_{\text{el}} = - \sum_i \frac{\nabla_{r_i}^2}{m_e} - \sum_I\sum_i \frac{Z_I e^2}{|R_I-r_i|} + \sum_i \sum_{j>i} \frac{e^2}{|r_i-r_j|}.\]

মূলত প্রাথমিক অবস্থায় শক্তি প্রাপ্তি হয়ঃ

\[E_0 = \frac{\langle \Psi_0 | H_{\text{el}} | \Psi_0 \rangle}{\langle \Psi_0 | \Psi_0 \rangle}\]

যেখানে \(\Psi_0\) সিস্টেমের প্রাথমিক অবস্থা।

তবুও, এই সমস্যাটির মাত্রা স্বাধীনতার মাত্রা (ডিগ্রিস অফ ফ্রিডম) হারে বৃদ্ধি পায়। এই সমস্যাটি সমাধানের লক্ষ্যে, আমরা কোয়ান্টাম কম্পিউটারে \(\Psi_0\) তৈরি ও এর মাধ্যমে হ্যামিল্টোনিয় প্রত্যাশিত মানটি (অথবা \(E_0\)) সরাসরি পরিমাপ করতে পারি।

তাহলে আমরা এইটা কিভাবে করি?

Starting from the Hartree-Fock solution#

A good starting point for solving this problem is the Hartree-Fock (HF) method. This method approximates the N-body problem by N one-body problems where each electron evolves in the mean-field of the others. Classically solving the HF equations is efficient and leads to the exact exchange energy but does not include any electron correlation. Therefore, it is usually a good starting point to which to add correlation.

হ্যামিল্টোনিয়ানকে এইচ-এফ পদ্ধতির সমাধান বেসিস(একটি কলাম ভেক্টর)গুলিতে পুনরায় প্রকাশ করা যায়, যাকে আণবিক কক্ষপথও বলে।

\[\hat{H}_{elec}=\sum_{pq} h_{pq} \hat{a}^{\dagger}_p \hat{a}_q + \frac{1}{2} \sum_{pqrs} h_{pqrs} \hat{a}^{\dagger}_p \hat{a}^{\dagger}_q \hat{a}_r \hat{a}_s\]

১-বডি ইন্টেগ্রাল

\[h_{pq} = \int \phi^*_p(r) \left( -\frac{1}{2} \nabla^2 - \sum_{I} \frac{Z_I}{R_I- r} \right) \phi_q(r)dr\]

এবং ২-বডি ইন্টেগ্রাল

\[h_{pqrs} = \int \frac{\phi^*_p(r_1) \phi^*_q(r_2) \phi_r(r_2) \phi_s(r_1)}{|r_1-r_2|}dr_1dr_2.\]

এম.ও. (MO) অধিকৃত বা ভার্চুয়াল(অনধিকৃত) হতে পারে। একটি এম.ও.(MO) তে 2 টি ইলেকট্রন থাকতে পারে। তবে, এর পরবর্তীতে আমরা আসলে স্পিন কক্ষপথসমূহের(অরবিটাল) সাথে কাজ করি যা স্পিন ডাউনের (\(\beta\)) ইলেকট্রনের একটি স্পিন আপের (\(\alpha\)) সাথে যুক্ত। এইভাবে স্পিন কক্ষপথসমূহ (অরবিটাল) একটি ইলেকট্রন ধারণ করতে পারে বা খালি থাকতে পারে।

Note: when referring to the number of orbitals, we will be using the number of spatial orbitals. This refers to any orbital in Cartesian space (whether its a molecular orbital or in another basis does not matter here). Each spatial orbital is then generally split into two spin orbitals.

আমরা এখন দেখাই কীভাবে Qiskit-এর দ্বারা এই পদক্ষেপগুলি দৃঢ়ভাবে বাস্তবায়িত করা যায়।

Obtaining an initial Hartree-Fock solution#

Qiskit is interfaced with different classical codes which are able to find the HF solutions. Interfacing between Qiskit and the following codes is already available:

  • Gaussian

  • Psi4

  • PySCF

নিম্নলিখিতগুলিতে আমরা কোনও চার্জ ছাড়া একক অবস্থায় (singlet state) ভারসাম্য (equilibrium) বন্ড দৈর্ঘ্যে (0.735 অ্যাংস্ট্রম) হাইড্রোজেন অণুর জন্য একটি পাই এসসিএফ (PySCF) ড্রাইভার স্থাপন করেছি।

[1]:
from qiskit_nature.units import DistanceUnit
from qiskit_nature.second_q.drivers import PySCFDriver

driver = PySCFDriver(
    atom="H 0 0 0; H 0 0 0.735",
    basis="sto3g",
    charge=0,
    spin=0,
    unit=DistanceUnit.ANGSTROM,
)

Running this driver, will yield an ElectronicStructureProblem, Qiskit Nature’s representation of the electronic structure problem which we are interested in solving. For further information about the drivers see https://qiskit.org/documentation/nature/apidocs/qiskit_nature.second_q.drivers.html

[2]:
problem = driver.run()
print(problem)
<qiskit_nature.second_q.problems.electronic_structure_problem.ElectronicStructureProblem object at 0x7f3bc13406a0>

The ElectronicStructureProblem and its components#

Let us spend some time to understand this problem instance and its components.

The ElectronicEnergy Hamiltonian#

The most important aspect is the internal Hamiltonian; in this case an ElectronicEnergy hamiltonian. This class is able to generate the second-quantized operator from the 1- and 2-body integrals which the classical code has computed for us.

IMPORTANT: The container class for the integral coefficients (PolynomialTensor) requires the 2-body terms to be provided in physicist order!

[3]:
hamiltonian = problem.hamiltonian

coefficients = hamiltonian.electronic_integrals
print(coefficients.alpha)
Polynomial Tensor
 "+-":
[[-1.25633907e+00 -6.21867875e-17]
 [-7.78036432e-17 -4.71896007e-01]]
 "++--":
[[[[6.75710155e-01 1.12401641e-16]
   [1.56722377e-16 1.80931200e-01]]

  [[1.92605510e-16 1.80931200e-01]
   [6.64581730e-01 2.59298923e-16]]]


 [[[8.68926823e-17 6.64581730e-01]
   [1.80931200e-01 1.82411770e-16]]

  [[1.80931200e-01 2.57172666e-16]
   [7.20426423e-17 6.98573723e-01]]]]
[4]:
second_q_op = hamiltonian.second_q_op()
print(second_q_op)
Fermionic Operator
number spin orbitals=4, number terms=36
  -1.2563390730032498 * ( +_0 -_0 )
+ -0.47189600728114245 * ( +_1 -_1 )
+ -1.2563390730032498 * ( +_2 -_2 )
+ -0.47189600728114245 * ( +_3 -_3 )
+ 0.33785507740175813 * ( +_0 +_0 -_0 -_0 )
+ 0.09046559989211565 * ( +_0 +_0 -_1 -_1 )
+ 0.09046559989211556 * ( +_0 +_1 -_0 -_1 )
+ 0.33229086512764827 * ( +_0 +_1 -_1 -_0 )
+ 0.33785507740175813 * ( +_0 +_2 -_2 -_0 )
+ 0.09046559989211565 * ( +_0 +_2 -_3 -_1 )
+ 0.09046559989211556 * ( +_0 +_3 -_2 -_1 )
+ 0.33229086512764827 * ( +_0 +_3 -_3 -_0 )
+ 0.33229086512764816 * ( +_1 +_0 -_0 -_1 )
+ 0.09046559989211574 * ( +_1 +_0 -_1 -_0 )
+ 0.09046559989211564 * ( +_1 +_1 -_0 -_0 )
+ 0.34928686136600906 * ( +_1 +_1 -_1 -_1 )
+ 0.33229086512764816 * ( +_1 +_2 -_2 -_1 )
+ 0.09046559989211574 * ( +_1 +_2 -_3 -_0 )
+ 0.09046559989211564 * ( +_1 +_3 -_2 -_0 )
+ 0.34928686136600906 * ( +_1 +_3 -_3 -_1 )
+ 0.33785507740175813 * ( +_2 +_0 -_0 -_2 )
+ 0.09046559989211565 * ( +_2 +_0 -_1 -_3 )
+ 0.09046559989211556 * ( +_2 +_1 -_0 -_3 )
+ 0.33229086512764827 * ( +_2 +_1 -_1 -_2 )
+ 0.33785507740175813 * ( +_2 +_2 -_2 -_2 )
+ 0.09046559989211565 * ( +_2 +_2 -_3 -_3 )
+ 0.09046559989211556 * ( +_2 +_3 -_2 -_3 )
+ 0.33229086512764827 * ( +_2 +_3 -_3 -_2 )
+ 0.33229086512764816 * ( +_3 +_0 -_0 -_3 )
+ 0.09046559989211574 * ( +_3 +_0 -_1 -_2 )
+ 0.09046559989211564 * ( +_3 +_1 -_0 -_2 )
+ 0.34928686136600906 * ( +_3 +_1 -_1 -_3 )
+ 0.33229086512764816 * ( +_3 +_2 -_2 -_3 )
+ 0.09046559989211574 * ( +_3 +_2 -_3 -_2 )
+ 0.09046559989211564 * ( +_3 +_3 -_2 -_2 )
+ 0.34928686136600906 * ( +_3 +_3 -_3 -_3 )

Note, that this is purely the electronic Hamiltonian of the system. That means, that the nuclear repulsion energy is not included. Instead, Qiskit Nature will add this constant energy offset in a post-processing step, in order to compute the total energy of your system. To learn how to include the nuclear repulsion energy in this operator, please refer to the documentation of the ElectronicEnergy class here.

[5]:
hamiltonian.nuclear_repulsion_energy  # NOT included in the second_q_op above
[5]:
0.7199689944489797

More attributes of the ElectronicStructureProblem#

Below we list some additional attributes of our problem instance:

[6]:
problem.molecule
[6]:
MoleculeInfo(symbols=['H', 'H'], coords=[(0.0, 0.0, 0.0), (0.0, 0.0, 1.3889487015553204)], multiplicity=1, charge=0, units=<DistanceUnit.BOHR: 'Bohr'>, masses=[1, 1])
[7]:
problem.reference_energy
[7]:
-1.1169989967540035
[8]:
problem.num_particles
[8]:
(1, 1)
[9]:
problem.num_spatial_orbitals
[9]:
2
[10]:
problem.basis
[10]:
<ElectronicBasis.MO: 'molecular'>

To learn more about the basis of your problem, please refer to the tutorial on the `BasisTransformer <05_problem_transformers.ipynb>`__.

Additional observables#

The ElectronicStructureProblem also contains additional operator factories, which will generate observables to be evaluated at the ground- and excited-states at the end of your computation.

[11]:
problem.properties
[11]:
<qiskit_nature.second_q.problems.electronic_properties_container.ElectronicPropertiesContainer at 0x7f3bc1340790>
[12]:
problem.properties.particle_number
[12]:
<qiskit_nature.second_q.properties.particle_number.ParticleNumber at 0x7f3bc1340820>
[13]:
problem.properties.angular_momentum
[13]:
<qiskit_nature.second_q.properties.angular_momentum.AngularMomentum at 0x7f3bc1340700>
[14]:
problem.properties.magnetization
[14]:
<qiskit_nature.second_q.properties.magnetization.Magnetization at 0x7f3bc1340760>
[15]:
problem.properties.electronic_dipole_moment
[15]:
<qiskit_nature.second_q.properties.dipole_moment.ElectronicDipoleMoment at 0x7f3bc1340880>

For more information about these properties, please refer to their tutorial.

Solving the ElectronicStructureProblem#

In the following, we will compute the ground-state of our problem instance. To learn more about the individual components that go into the GroundStateSolver, please refer to the ground state tutorial.

[16]:
from qiskit_algorithms import NumPyMinimumEigensolver
from qiskit_nature.second_q.algorithms import GroundStateEigensolver
from qiskit_nature.second_q.mappers import JordanWignerMapper

solver = GroundStateEigensolver(
    JordanWignerMapper(),
    NumPyMinimumEigensolver(),
)
[17]:
result = solver.solve(problem)
print(result)
=== GROUND STATE ENERGY ===

* Electronic ground state energy (Hartree): -1.857275030202
  - computed part:      -1.857275030202
~ Nuclear repulsion energy (Hartree): 0.719968994449
> Total ground state energy (Hartree): -1.137306035753

=== MEASURED OBSERVABLES ===

  0:  # Particles: 2.000 S: 0.000 S^2: 0.000 M: 0.000

=== DIPOLE MOMENTS ===

~ Nuclear dipole moment (a.u.): [0.0  0.0  1.3889487]

  0:
  * Electronic dipole moment (a.u.): [0.0  0.0  1.3889487]
    - computed part:      [0.0  0.0  1.3889487]
  > Dipole moment (a.u.): [0.0  0.0  0.0]  Total: 0.0
                 (debye): [0.0  0.0  0.0]  Total: 0.0

[18]:
import qiskit.tools.jupyter

%qiskit_version_table
%qiskit_copyright

Version Information

Qiskit SoftwareVersion
qiskit-terra0.24.0.dev0+2b3686f
qiskit-aer0.11.2
qiskit-ibmq-provider0.19.2
qiskit-nature0.6.0
System information
Python version3.9.16
Python compilerGCC 12.2.1 20221121 (Red Hat 12.2.1-4)
Python buildmain, Dec 7 2022 00:00:00
OSLinux
CPUs8
Memory (Gb)62.50002670288086
Thu Apr 06 08:53:41 2023 CEST

This code is a part of Qiskit

© Copyright IBM 2017, 2023.

This code is licensed under the Apache License, Version 2.0. You may
obtain a copy of this license in the LICENSE.txt file in the root directory
of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.

Any modifications or derivative works of this code must retain this
copyright notice, and modified files need to carry a notice indicating
that they have been altered from the originals.