How do I calculate orbitals and electrons so I can find the electronic hamiltonian (Quantum Chemistry)

Visualization of a transparent conductor

Here’s a visualization of a transparent circuit made with plotly dash. I got .xyz files from the Kaggle challenge for transparent conductors, however, I need to calculate the electrons and orbitals so I can calculate the electronic hamiltonian.

This transparent circuit has about 11 In, 15 Ga, 6 Al, and 48 O atoms with a total of 80 atoms.

How do I calculate the orbitals and electrons of this molecule so I can find the electronic hamiltonian?

80

In 1.7089214588200001 7.6848373406700006 6.6842861752599996
In 6.9778435088199995 7.6640093506700007 6.6569519702599997
In 3.6401549557799990 1.3345275526100000 1.8753704028000002
In 8.9090770057800004 1.3136995626100001 1.8480361978000002
In 1.0128447146199999 3.1657712464300003 1.8834757766800001
In 6.2817667646199995 3.1449432564299999 1.8561415716800003
Ga 4.3362316999799990 5.8535936468500003 6.6761808013800001
Al 9.6051537499800013 5.8327656568500004 6.6488465963800003
Ga 0.9664301943099999 5.9274893235700006 -0.0230097406750000
In 6.2353522443100005 5.9066613335700007 -0.0503439456750000
Ga 4.3629222256899993 3.0803356564300000 4.7861087206750001
Ga 9.6318442756899980 3.0595076664300001 4.7587745156750003
Ga 1.7219476154100000 1.4321721039900002 4.8048419522149999
Al 6.9908696654099991 1.4113441139900000 4.7775077472150000
Al 3.6574657045899999 7.6049419960100000 9.5941900177850012
In 8.9263877545900012 7.5841140060100001 9.5668558127850005
In 0.9362517411000001 0.2961809808600000 9.6208789112700011
Ga 6.2051737910999982 0.2753529908600000 9.5935447062700003
Ga 4.4430614570999989 8.7408745409000002 4.7588811927500005
Ga 9.7119835070999994 8.7200465508999994 4.7315469877500007
Al 1.7930244673000000 4.7851248355000005 4.7846629516500006
Al 7.0619465172999991 4.7642968455000005 4.7573287466500007
Al 3.5862887308999998 4.2519306862600006 9.5950971523700002
Ga 8.8552107809000002 4.2311026962600007 9.5677629473700012
Ga 3.6541673199900000 1.4239826846600003 7.5604326030350011
Ga 8.9230893699900005 1.4031546946600002 7.5330983980350004
In 1.7039200566099999 7.6006542502199999 2.7336919132249999
Ga 6.9728421066099981 7.5798262602199999 2.7063577082250001
In 4.3317966964899988 5.9136346909600004 2.7251460063850002
Ga 9.6007187464899992 5.8928067009600005 2.6978118013849999
Ga 1.0262906801100000 3.1110022439200007 7.5689785098750004
Ga 6.2952127301099994 3.0901742539200008 7.5416443048750006
O 4.4363233096299997 6.0392604067400013 8.5638083197350010
O 9.7052453596299983 6.0184324167400014 8.5364741147350003
O 0.9323769777700001 2.9915858215800002 3.7731339904050003
O 6.2012990277699993 2.9707578315800003 3.7457997854050005
O 3.5611032157300002 1.5209024641600002 3.7639272841250002
O 8.8300252657299989 1.5000744741600003 3.7365930791250004
O 1.8075970716700001 7.5099437641600000 8.5730150260150015
O 7.0765191216699987 7.4891157741600001 8.5456808210150008
O 2.7979909816299999 0.0886142374200000 6.0464035932950004
O 8.0669130316299995 0.0677862474200000 6.0190693882950006
O 2.5442771505699993 8.9267673355400010 1.2027660981250001
O 7.8131992005699997 8.9059393455400020 1.1754318931250001
O 5.1616754141299994 4.5716012869200009 1.2023700510450002
O 10.4305974641300008 4.5507732969200010 1.1750358460450001
O 0.1805927180700000 4.4437802860400000 6.0467996403750002
O 5.4495147680699993 4.4229522960400001 6.0194654353750003
O 0.1143669334900000 7.4578165187400005 1.1427678313450000
O 5.3832889834899982 7.4369885287400006 1.1154336263450000
O 5.2271002243099991 1.5570964282999999 5.9522269322350008
O 10.4960222743099987 1.5362684382999998 5.9248927272350000
O 2.5980907869899998 2.9556677184400000 5.9616539049949999
O 7.8670128369899990 2.9348397284400001 5.9343196999950001
O 2.7433763708100001 6.0592452286000009 1.1333408585850000
O 8.0122984208099997 6.0384172386000010 1.1060066535849999
O 5.1828900199999994 7.5251386746300009 6.0981660865100009
O 10.4518120699999990 7.5043106846300009 6.0708318815100002
O 0.1602792084000000 1.4907701024900000 1.3244503987300003
O 5.4292012583999991 1.4699421124900001 1.2971161937300002
O 2.8007582197999996 3.0127375371900009 1.3061026335300001
O 8.0696802698000010 2.9919095471900006 1.2787684285300003
O 2.5424110085999994 6.0031712399300012 6.1165138517100006
O 7.8113330585999989 5.9823432499300004 6.0891796467100008
O 1.9514515858499999 1.5502269032300002 8.3301696586350005
O 7.2203736358499997 1.5293989132300001 8.3028354536349998
O 3.4145454129499995 7.4790377126099994 3.4864322700450003
O 8.6834674629500004 7.4582097226099995 3.4590980650450001
O 0.7744204007500001 6.0472103620100013 3.5045047021450002
O 6.0433424507500000 6.0263823720100014 3.4771704971449999
O 4.5915765980499996 2.9820542538300003 8.3120972265350002
O 9.8604986480499992 2.9612262638300000 8.2847630215350012
O 4.4499090437199991 0.0179620167700000 8.6494607623100013
O 9.7188310937199986 -0.0028659732300000 8.6221265573100005
O 0.9194920962799999 9.0132942592299994 3.8223846096900003
O 6.1884141462799986 8.9924662692299986 3.7950504046900004
O 3.5363239611199999 4.5139040760500011 3.8224290955700004
O 8.8052460111199995 4.4930760860500003 3.7950948905700006
O 1.8330771788800000 4.5173521999499995 8.6494162764300011
O 7.1019992288799996 4.4965242099499996 8.6220820714300004

Pennylane’s chemistry tutorial

Transparent conductors

Plotly’s dash speck

Hi Bayaniblues,

Thank you for your question and welcome to PennyLane’s forum.

I will clarify important aspects here but the tutorial Quantum Chemistry with PennyLane is the (almost perfect :slight_smile: ) guide to build the electronic Hamiltonian of molecules using PennyLane-QChem (PL-QChem).

The construction of the molecular Hamiltonian with PL-QChem involves four main steps:

1- First, you have to input the atomic structure of your system.
This is something you can easily do with the function read_structure:

from pennylane import qchem
geometry = qchem.read_structure(file_with_structure)

geometry is a list containing the symbol and the Cartesian coordinates of the 80 atoms.

2- Second, you have to compute the meanfield electronic structure of the molecule via the Hartree-Fock (HF) method to obtain the molecular orbitals. PL-QChem uses the quantum chemistry packages PySCF or Psi4 which requires to define several parameters (See the above mentioned tutorial for a detailed explanation):

name = name_of_the_molecule
charge = 0          # (neutral system)
multiplicity = 1    # (singlet HF state)
basis =' sto-3g'    # (minimum basis)
path_hf_data = qchem.meanfield_data(
    name,
    geometry,
    charge,
    multiplicity,
    basis,
    qc_package="pyscf"
)

The output variable path_hf_data stores the path to the directory containing an hdf5-formatted file with the Hartree-Fock electronic structure of your molecule.

VERY IMPORTANT: The system you are willing to simulate is extremely challenging even for large High Performance Computers (HPC). Your “molecule” has 80 atoms, including III-V compounds and metals, and a total number of electrons N_e=1466 which means the HF calculation will involve hundreds of molecular orbitals. I am inclined to believe that neither PySCF nor Psi4 can handle this calculation in a desktop but you can try and let me know.

3- Next step is to define an active space (please, see the tutorial for a comprehensive explanation of what an active space is). At present, we don’t have a quantum computer with hundreds of qubits to encode the full set of HF molecular orbitals. We can only encode few of them, in particular those orbitals (called active orbitals) around the highest-occupied molecular orbital (HOMO) that you think are the important ones for the property you want to simulate. For example, you can define a symmetric active space with 4 electrons populating 4 active orbitals. I stress that this is a very bad approximation for your system but it will certainly allow you to build an (equally bad) approximated Hamiltonian:

core, active = qchem.active_space(
    name,
    path_hf_data,
    n_active_electrons=4,
    n_active_orbitals=4)

The outputs core and active are lists containing the indices of the core (orbitals not included) and active orbitals, respectively.

4- The last step involve using the function decompose_hamiltonian to obtain the electronic Hamiltonian already represented in the basis of Pauli matrices using the Jordan-Wigner or Bravyi-Kitaev transformation:

qubit_hamiltonian = qchem.decompose_hamiltonian(
    name,
    path_hf_data,
    mapping="jordan_wigner",
    docc_mo_indices=core,
    active_mo_indices=active
)

Notice that PL-QChem provides also a driver function to perform all of the above with a single call statement:

qubit_hamiltonian, n_qubits = qchem.generate_hamiltonian(
    name_of_the_molecule,
    file_with_structure,
    charge,
    multiplicity,
    basis,
    qc_package="pyscf",
    n_active_electrons=4,
    n_active_orbitals=4,
    mapping="jordan_wigner"
)

Just to summarise:

  • Again, I strongly encourage you to take a look to the tutorial Quantum Chemistry with PennyLane.

  • The molecule you want to simulate is a challenging one and it requires huge computational resources if you want to perform relatively accurate calculations. At present, such systems can only be simulated in HPC systems using Density Functional approximations (DFT). That’s why we are trying to build quantum computers :slight_smile:.

  • Check out also the tutorial A brief overview of VQE explaining how to use the Variational Quantum Eigensolver (VQE) algorithm to find the ground state of molecular Hamiltonians.

I hope this helps and feel free to get back to us if you need further assistance.

1 Like