from qiskit_nature.drivers.second_quantization import PySCFDriver
from qiskit_nature.transformers.second_quantization.electronic import FreezeCoreTransformer
from qiskit_nature.problems.second_quantization.electronic import ElectronicStructureProblem

driver = PySCFDriver(atom="O 0.0 0.0 0.115; H 0.0 0.754 -0.459; H 0.0 -0.754 -0.459")

transformer = FreezeCoreTransformer()

problem = ElectronicStructureProblem(driver, [transformer])

second_q_ops = problem.second_q_ops()
# implicitly calls driver.run() EVERY time!

for name, op in second_q_ops.items():
    print(f"{name}\n{op}\n")

hamiltonian = second_q_ops[problem.main_property_name]
print(problem.main_property_name)
print(hamiltonian)

from qiskit_nature.second_q.drivers import PySCFDriver
from qiskit_nature.second_q.transformers import FreezeCoreTransformer

driver = PySCFDriver(atom="O 0.0 0.0 0.115; H 0.0 0.754 -0.459; H 0.0 -0.754 -0.459")

transformer = FreezeCoreTransformer()

problem = driver.run()

transformed_problem = transformer.transform(problem)

hamiltonian, aux_ops = transformed_problem.second_q_ops()

print(hamiltonian)

for name, op in aux_ops.items():
    print(f"{name}\n{op}\n")

import qiskit.tools.jupyter

%qiskit_version_table
%qiskit_copyright