Ejemplo n.º 1
0
point_nucleus = True
if run_ccsd:
    description = 'R' + str(bond_length) + '_ccsd'
else:
    description = 'R' + str(bond_length) + '_scf'

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

molecule = run_dirac(molecule,
                     fcidump=True,
                     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)

print("spinorbs = ", molecule.get_integrals_FCIDUMP()[1])
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.º 2
0
                               charge=charge,
                               description=description,
                               data_directory=data_directory)

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)
Ejemplo n.º 3
0
print()
run_ccsd = True
point_nucleus = True
description = 'R' + str(R) + '_T' + str(angle) + '_ccsd'

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

molecule = run_dirac(molecule,
                     fcidump=True,
                     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)

print('Spinorbs = ', molecule.get_integrals_FCIDUMP()[1])
print('size spinorbs : {}'.format(len(molecule.get_integrals_FCIDUMP()[1])))
#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))