diff --git a/src/qutip_qip/device/processor.py b/src/qutip_qip/device/processor.py index 2e221ba8..0fa2966f 100644 --- a/src/qutip_qip/device/processor.py +++ b/src/qutip_qip/device/processor.py @@ -1206,9 +1206,9 @@ def run_state( else: total_circuit_time = 0.0 if is_qutip5: - options = kwargs.get("options", qutip.SolverOptions()) - if options["max_step"] == 0.0: - options["max_step"] = total_circuit_time / 10 + options = kwargs.get("options", qutip.Options()) + if options.get("max_step", 0.0) == 0.0: + options["max_step"] = total_circuit_time / 25 else: options = kwargs.get("options", qutip.Options()) if options.max_step == 0.0: @@ -1221,7 +1221,7 @@ def run_state( ) elif solver == "mcsolve": evo_result = mcsolve( - H=noisy_qobjevo, psi0=init_state, tlist=tlist, **kwargs + noisy_qobjevo, init_state, tlist=tlist, **kwargs ) return evo_result diff --git a/src/qutip_qip/qiskit/backend.py b/src/qutip_qip/qiskit/backend.py index af39f028..1b256504 100644 --- a/src/qutip_qip/qiskit/backend.py +++ b/src/qutip_qip/qiskit/backend.py @@ -209,7 +209,7 @@ def convert_to_hex(count): )[0] exp_res_data = ExperimentResultData( - counts=counts, statevector=Statevector(data=np.array(statevector)) + counts=counts, statevector=Statevector(data=statevector.full()) ) header = QobjExperimentHeader.from_dict( @@ -366,9 +366,9 @@ def _parse_results( exp_res_data = ExperimentResultData( counts=counts, - statevector=Statevector(data=np.array(final_state)) + statevector=Statevector(data=final_state.full()) if final_state.type == "ket" - else DensityMatrix(data=np.array(final_state)), + else DensityMatrix(data=final_state.full()), ) header = QobjExperimentHeader.from_dict( diff --git a/tests/test_device.py b/tests/test_device.py index 6456e43e..3e488cb6 100644 --- a/tests/test_device.py +++ b/tests/test_device.py @@ -13,10 +13,7 @@ CircularSpinChain, SCQubits) from packaging.version import parse as parse_version -if parse_version(qutip.__version__) < parse_version('5.dev'): - from qutip import Options as SolverOptions -else: - from qutip import SolverOptions +from qutip import Options _tol = 3.e-2 @@ -126,7 +123,7 @@ def test_numerical_evolution( init_state = _ket_expaned_dims(state, device.dims) else: init_state = state - options = SolverOptions(store_final_state=True, nsteps=50_000) + options = Options(store_final_state=True, nsteps=50_000) result = device.run_state(init_state=init_state, analytical=False, options=options) @@ -183,7 +180,7 @@ def test_numerical_circuit(circuit, device_class, kwargs, schedule_mode): init_state = _ket_expaned_dims(state, device.dims) else: init_state = state - options = SolverOptions(store_final_state=True, nsteps=50_000) + options = Options(store_final_state=True, nsteps=50_000) result = device.run_state(init_state=init_state, analytical=False, options=options)