from qiskit_chemistry import QiskitChemistry
from qiskit import Aer

# from qiskit import IBMQ
# IBMQ.load_accounts()
# backend = IBMQ.get_backend('ibmq_16_melbourne')

from qiskit import Aer
backend = Aer.get_backend('statevector_simulator')

# Input dictionary to configure Qiskit AQUA Chemistry for the chemistry problem.

qiskit_chemistry_dict = {
    'driver': {'name': 'HDF5'},
    'HDF5': {'hdf5_input': 'H2/0.7_sto-3g.hdf5'},
    'operator': {'name': 'hamiltonian'},
    'algorithm': {'name': 'VQE'},
    'optimizer': {'name': 'COBYLA'},
    'variational_form': {'name': 'UCCSD'},
    'initial_state': {'name': 'HartreeFock'}
}

solver = QiskitChemistry()
result = solver.run(qiskit_chemistry_dict, backend=backend)

print('Ground state energy: {}'.format(result['energy']))

for line in result['printable']:
    print(line)

