# Copyright 2018-2021 Xanadu Quantum Technologies Inc.

# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at

#     http://www.apache.org/licenses/LICENSE-2.0

# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""
Benchmarks for creating a differentiable molecular Hamiltonian.
"""
import pennylane as qml
import sys
import time
from pennylane import numpy as np

if len(sys.argv) != 2:
    print("python benchmark.py <num_qubits>")
    sys.exit(1)

symbols = ["Li", "H"]
geometry = np.array([[0.0, 0.0, 0.0], [0.0, 0.0, 2.969280527]])

start = time.time()
#PROFILE_BEGIN
H = qml.qchem.molecular_hamiltonian(symbols, geometry, args=[geometry])[0]
#PROFILE_END
end = time.time()
print("time =", (end - start))
