Skip to main contentIBM Quantum Documentation
You are viewing the API reference for an old version of Qiskit SDK. Switch to latest version

QMolecule

QMolecule(filename=None)

GitHub(opens in a new tab)

Molecule data class containing driver result.

When one of the chemistry drivers is run and instance of this class is returned. This contains various properties that are made available in a consistent manner across the various drivers.

Note that values here, for the same input molecule to each driver, may be vary across the drivers underlying code implementation. Also some drivers may not provide certain fields such as dipole integrals in the case of PyQuanteDriver.

This class provides methods to save it and load it again from an HDF5 file


Attributes

BOHR

= 0.52917721092

DEBYE

= 0.393430307

QMOLECULE_VERSION

= 2

core_orbitals

List[int]

Returns: A list of core orbital indices.

Return type

List[int]

filename

returns temp file path

one_body_integrals

Returns one body electron integrals.

symbols

= ['_', 'H', 'He', 'Li', 'Be', 'B', 'C', 'N', 'O', 'F', 'Ne', 'Na', 'Mg', 'Al', 'Si', 'P', 'S', 'Cl', 'Ar', 'K', 'Ca', 'Sc', 'Ti', 'V', 'Cr', 'Mn', 'Fe', 'Co', 'Ni', 'Cu', 'Zn', 'Ga', 'Ge', 'As', 'Se', 'Br', 'Kr', 'Rb', 'Sr', 'Y', 'Zr', 'Nb', 'Mo', 'Tc', 'Ru', 'Rh', 'Pd', 'Ag', 'Cd', 'In', 'Sn', 'Sb', 'Te', 'I', 'Xe', 'Cs', 'Ba', 'La', 'Ce', 'Pr', 'Nd', 'Pm', 'Sm', 'Eu', 'Gd', 'Tb', 'Dy', 'Ho', 'Er', 'Tm', 'Yb', 'Lu', 'Hf', 'Ta', 'W', 'Re', 'Os', 'Ir', 'Pt', 'Au', 'Hg', 'Tl', 'Pb', 'Bi', 'Po', 'At', 'Rn', 'Fr', 'Ra', 'Ac', 'Th', 'Pa', 'U', 'Np', 'Pu', 'Am', 'Cm', 'Bk', 'Cf', 'Es', 'Fm', 'Md', 'No', 'Lr', 'Rf', 'Db', 'Sg', 'Bh', 'Hs', 'Mt', 'Ds', 'Rg', 'Cn', 'Nh', 'Fl', 'Mc', 'Lv', 'Ts', 'Og']

two_body_integrals

Returns two body electron integrals.

x_dipole_integrals

returns x_dipole_integrals

y_dipole_integrals

returns y_dipole_integrals

z_dipole_integrals

returns z_dipole_integrals


Methods

Z

QMolecule.Z(natom)

has_dipole_integrals

QMolecule.has_dipole_integrals()

Check if dipole integrals are present.

load

QMolecule.load()

loads info saved.

log

QMolecule.log()

log properties

onee_to_spin

static QMolecule.onee_to_spin(mohij, mohij_b=None, threshold=1e-12)

Convert one-body MO integrals to spin orbital basis

Takes one body integrals in molecular orbital basis and returns integrals in spin orbitals ready for use as coefficients to one body terms 2nd quantized Hamiltonian.

Parameters

  • mohij (numpy.ndarray) – One body orbitals in molecular basis (Alpha)
  • mohij_b (numpy.ndarray) – One body orbitals in molecular basis (Beta)
  • threshold (float) – Threshold value for assignments

Returns

One body integrals in spin orbitals

Return type

numpy.ndarray

oneeints2mo

static QMolecule.oneeints2mo(ints, moc)

Converts one-body integrals from AO to MO basis

Returns one electron integrals in AO basis converted to given MO basis

Parameters

  • ints (numpy.ndarray) – N^2 one electron integrals in AO basis
  • moc (numpy.ndarray) – Molecular orbital coefficients

Returns

integrals in MO basis

Return type

numpy.ndarray

remove_file

QMolecule.remove_file(file_name=None)

remove file

save

QMolecule.save(file_name=None)

Saves the info from the driver.

twoe_to_spin

static QMolecule.twoe_to_spin(mohijkl, mohijkl_bb=None, mohijkl_ba=None, threshold=1e-12)

Convert two-body MO integrals to spin orbital basis

Takes two body integrals in molecular orbital basis and returns integrals in spin orbitals ready for use as coefficients to two body terms in 2nd quantized Hamiltonian.

Parameters

  • mohijkl (numpy.ndarray) – Two body orbitals in molecular basis (AlphaAlpha)
  • mohijkl_bb (numpy.ndarray) – Two body orbitals in molecular basis (BetaBeta)
  • mohijkl_ba (numpy.ndarray) – Two body orbitals in molecular basis (BetaAlpha)
  • threshold (float) – Threshold value for assignments

Returns

Two body integrals in spin orbitals

Return type

numpy.ndarray

twoeints2mo

static QMolecule.twoeints2mo(ints, moc)

Converts two-body integrals from AO to MO basis

Returns two electron integrals in AO basis converted to given MO basis

Parameters

  • ints (numpy.ndarray) – N^2 two electron integrals in AO basis
  • moc (numpy.ndarray) – Molecular orbital coefficients

Returns

integrals in MO basis

Return type

numpy.ndarray

twoeints2mo_general

static QMolecule.twoeints2mo_general(ints, moc1, moc2, moc3, moc4)

Was this page helpful?
Report a bug or request content on GitHub.