You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from bqskit import MachineModel
from bqskit.qis.state.state import StateVector
from bqskit import compile
n = 2
coupling_graph = [(i, i + 1) for i in range(n - 1)]
model = MachineModel(n, coupling_graph=coupling_graph)
out_circuit = compile(StateVector([0, 1, 0, 0]), model=model, optimization_level=2)
It should get the circuit that prepares the state but I got the following error:
Traceback (most recent call last):
File "/.venv/lib/python3.10/site-packages/bqskit/compiler/compiler.py", line 439, in _send_recv
return self._recv_handle_log_error()
File "/.venv/lib/python3.10/site-packages/bqskit/compiler/compiler.py", line 467, in _recv_handle_log_error
raise RuntimeError(payload)
RuntimeError: Traceback (most recent call last):
File "/.venv/lib/python3.10/site-packages/bqskit/runtime/worker.py", line 462, in _try_step_next_ready_task
future = task.step(self._get_desired_result(task))
File "/.venv/lib/python3.10/site-packages/bqskit/runtime/task.py", line 115, in step
to_return = self.coro.send(send_val)
File "/.venv/lib/python3.10/site-packages/bqskit/runtime/task.py", line 149, in run
return await self.fnargs[0](*self.fnargs[1], **self.fnargs[2])
File "/.venv/lib/python3.10/site-packages/bqskit/compiler/task.py", line 54, in run
await self.workflow.run(self.circuit, self.data)
File "/.venv/lib/python3.10/site-packages/bqskit/compiler/workflow.py", line 75, in run
await pass_obj.run(circuit, data)
File "/.venv/lib/python3.10/site-packages/bqskit/passes/processing/scan.py", line 129, in run
working_copy.instantiate(target, **instantiate_options)
File "/.venv/lib/python3.10/site-packages/bqskit/ir/circuit.py", line 2901, in instantiate
instantiater.multi_start_instantiate_inplace(self, target, multistarts)
File "/.venv/lib/python3.10/site-packages/bqskit/ir/opt/instantiaters/minimization.py", line 110, in multi_start_instantiate_inplace
params_list = [self.instantiate(circuit, target, x0) for x0 in starts]
File "/.venv/lib/python3.10/site-packages/bqskit/ir/opt/instantiaters/minimization.py", line 110, in
params_list = [self.instantiate(circuit, target, x0) for x0 in starts]
File "/.venv/lib/python3.10/site-packages/bqskit/ir/opt/instantiaters/minimization.py", line 68, in instantiate
return self.minimizer.minimize(cost, x0)
TypeError: AttributeError: 'HilbertSchmidtCost' object has no attribute 'get_residuals'
I didn't get the error when setting the optimization level to 1.
The text was updated successfully, but these errors were encountered:
It should get the circuit that prepares the state but I got the following error:
I didn't get the error when setting the optimization level to 1.
The text was updated successfully, but these errors were encountered: