Ejemplo n.º 1
0
molecule = run_dirac(molecule,
                     fcidump=fcidump,
                     point_nucleus=point_nucleus,
                     delete_input=delete_input,
                     delete_xyz=delete_xyz,
                     delete_output=delete_output,
                     delete_MRCONEE=delete_MRCONEE,
                     delete_MDCINT=delete_MDCINT,
                     run_ccsd=run_ccsd)

molecular_hamiltonian = molecule.get_molecular_hamiltonian()[0]
number_orbs = len(molecule.get_integrals_FCIDUMP()[1])
print('size spinorbs : {}'.format(number_orbs))
qubit_hamiltonian = jordan_wigner(molecular_hamiltonian)
evs = eigenspectrum(qubit_hamiltonian)
print('Hartree-Fock energy of {} Hartree.'.format(molecule.get_energies()[0]))
print('MP2 energy of {} Hartree. (WRONG)'.format(molecule.get_energies()[1]))
print('CCSD energy of {} Hartree. (WRONG)'.format(molecule.get_energies()[2]))
print('Solving the Qubit Hamiltonian (Jordan-Wigner): \n {}'.format(evs))

fermion_operator = get_fermion_operator(molecular_hamiltonian)
qubit_hamiltonian = bravyi_kitaev(fermion_operator)
evs = eigenspectrum(qubit_hamiltonian)
print('Solving the Qubit Hamiltonian (Bravyi-Kitaev): \n {}'.format(evs))
#symmetry_conserving_bravyi_kitaev(fermionicoperator,number_of_active_orbs,number_of_active_elec)
qubit_hamiltonian = symmetry_conserving_bravyi_kitaev(fermion_operator,
                                                      number_orbs, 3)
evs = eigenspectrum(qubit_hamiltonian)
print(
    'Solving the Qubit Hamiltonian (Bravyi-Kitaev) Symmetry conserving: \n {}'.
    format(evs))
Ejemplo n.º 2
0
    description = 'R' + str(bond_length) + '_scf'
relativistic = True

molecule = MolecularData_Dirac(geometry=geometry,
                               basis=basis,
                               multiplicity=multiplicity,
                               charge=charge,
                               speed_of_light=speed_of_light,
                               description=description,
                               relativistic=relativistic,
                               data_directory=data_directory)

molecule = run_dirac(molecule,
                     delete_input=delete_input,
                     delete_xyz=delete_xyz,
                     delete_output=delete_output,
                     delete_MRCONEE=delete_MRCONEE,
                     delete_MDCINT=delete_MDCINT,
                     delete_FCIDUMP=delete_FCIDUMP,
                     run_ccsd=run_ccsd,
                     relativistic=relativistic,
                     speed_of_light=speed_of_light)

molecular_hamiltonian = molecule.get_molecular_hamiltonian()[0]
qubit_hamiltonian = jordan_wigner(molecular_hamiltonian)
evs = eigenspectrum(qubit_hamiltonian)
print('Hartree-Fock energy of {} Hartree.'.format(molecule.get_energies()[0]))
print('MP2 energy of {} Hartree.'.format(molecule.get_energies()[1]))
print('CCSD energy of {} Hartree.'.format(molecule.get_energies()[2]))
print('Solving the Qubit Hamiltonian (Jordan-Wigner): \n {}'.format(evs))
Ejemplo n.º 3
0
delete_MDCINT = True
geometry = [('H', (0., 0., 0.)), ('H', (0., 0., bond_length))]

print()
print('#'*40)
print('NONREL Dirac calculation')
print('#'*40)
print()
run_dft="LDA"
point_nucleus = True
description = 'R' + str(bond_length) + '_' + run_dft

molecule = MolecularData_Dirac(geometry=geometry,
                               basis=basis,
                               charge=charge,
                               description=description,
                               data_directory=data_directory)

molecule = run_dirac(molecule,
                    point_nucleus=point_nucleus,
                    delete_input=delete_input,
                    delete_xyz=delete_xyz,
                    delete_output=delete_output,
                    delete_MRCONEE=delete_MRCONEE,
                    delete_MDCINT=delete_MDCINT,
                    NONREL=True,
                    get="DFCOEF",
                    run_dft=run_dft)

print('DFT energy of {} Hartree.'.format(molecule.get_energies()[0]))
Ejemplo n.º 4
0
    geometry = [('He', (0., 0., 0.)), ('He', (0., 0., bond_length))]
    molecule = MolecularData_Dirac(geometry=geometry,
                                   basis=basis,
                                   charge=charge,
                                   description=description,
                                   data_directory=data_directory)

    molecule = run_dirac(molecule,
                         point_nucleus=point_nucleus,
                         delete_input=delete_input,
                         delete_xyz=delete_xyz,
                         delete_output=delete_output,
                         delete_MRCONEE=delete_MRCONEE,
                         delete_MDCINT=delete_MDCINT,
                         run_ccsd=run_ccsd)
    hf_energies += [molecule.get_energies()[0]]
    mp2_energies += [molecule.get_energies()[1]]
    ccsd_energies += [molecule.get_energies()[2]]

    molecule = run_dirac(molecule,
                         point_nucleus=point_nucleus,
                         delete_input=delete_input,
                         delete_xyz=delete_xyz,
                         delete_output=delete_output,
                         delete_MRCONEE=delete_MRCONEE,
                         delete_MDCINT=delete_MDCINT,
                         run_fci=True)
    fci_energies += [molecule.get_energies()[3]]
with open("He2_diss.dat", "w") as f:
    f.write('%15s %15s %15s %15s %15s\n' %
            ("bond_length", "HF", "MP2", "CCSD", "FCI"))
Ejemplo n.º 5
0
molecule = MolecularData_Dirac(geometry=geometry,
                               basis=basis,
                               charge=charge,
                               description=description,
                               data_directory=data_directory)

molecule = run_dirac(molecule,
                     fcidump=fcidump,
                     point_nucleus=point_nucleus,
                     properties=properties,
                     save=save,
                     delete_input=delete_input,
                     delete_xyz=delete_xyz,
                     delete_output=delete_output,
                     delete_MRCONEE=delete_MRCONEE,
                     delete_MDCINT=delete_MDCINT)

print('Hartree-Fock energy of {} Hartree. From the hdf5 file: {}'.format(
    molecule.get_energies()[0], molecule.get_from_file('hf_energy')))
print('Dipole moment: {}. From the hdf5 file: {}.'.format(
    molecule.get_elecdipole(), molecule.get_from_file('elec_dipole')))
print('Quadrupole moment: {}. From the hdf5 file: {}'.format(
    molecule.get_elecquadrupole(), molecule.get_from_file('elec_quadrupole')))
print('Polarizability: {}. From the hdf5 file: {}'.format(
    molecule.get_elecpolarizability(),
    molecule.get_from_file('elec_polarizability')))
print(
    "The gradient can be read in the output. I've not define an option to extract it from the ouput yet."
)