TransWikia.com

How to get a molecular Hamiltonians in OpenFermion

Quantum Computing Asked by cloudfire on February 2, 2021

I want to get a jordan_wigner_hamiltonians of a molecule-ion by using jordan_wignerget_fermion_operator(molecule.get_molecular_hamiltonian()). But I can only get the molecular Hamiltonians no matter how I set the charge and multiplicity.

How I can get a molecular Hamiltonians which have more (or less) electrons for example HeH+?

One Answer

Qiskit allows you to build the customized geometry of the molecule. You can also adjust the charge and multiplicity. For example, to build the Hydrogen molecule with a given equilibrium distance ED, you can write:

molecule = Molecule(geometry=[['H', [0., 0., 0.]],
                              ['H', [0., 0., ed]]],
                             charge=0, multiplicity=1)

Next, you can do this to get the Pauli operators:

qubit_op, _ = fermionic_transformation.transform(driver)

Finally this code gives you a dictionary of the weights and the decompositions of the Hamiltonian:

    decompositions = {}
    for el in qubit_op.oplist:
        ceof, pauli = [x.strip() for x in str(el).split('*')]
        decompositions[pauli] = ceof

This tutorial explains every detail. Just make sure you have the latest version of Qiskit installed. https://qiskit.org/documentation/tutorials/chemistry/01_electronic_structure.html

Answered by Amin on February 2, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP