from blueqat.pauli import I
from blueqat import Circuit
from blueqat.vqe import *
h = 3 * I
runner = Vqe(QaoaAnsatz(h.to_expr()))
runner.run()
Error:
Traceback (most recent call last):
File "bug_constant_hamiltonian.py", line 6, in <module>
runner = Vqe(QaoaAnsatz(h.to_expr()))
File "/home/penguin/blueqat/blueqat/vqe.py", line 64, in __init__
super().__init__(hamiltonian, step * 2)
File "/home/penguin/blueqat/blueqat/vqe.py", line 30, in __init__
self.n_qubits = self.hamiltonian.max_n() + 1
File "/home/penguin/blueqat/blueqat/pauli.py", line 709, in max_n
return max(term.max_n() for term in self.terms if term.ops)
ValueError: max() arg is an empty sequence
Code:
Error: