Skip to content

Results ​

MENOSBackend.run returns a MENOSJob, and job.result() is a standard Qiskit qiskit.result.Result. Everything you know about that class applies.

What is in it ​

FieldValue
successTrue for a completed job
backend_name"menos"
backend_versionThe installed package version
job_idA UUID string
time_takenSeconds spent executing and sampling
get_counts()Present when shots > 0 and the circuit measures
get_statevector()Present when want_statevector=True
results[0].seed_simulatorThe seed that was used, including a drawn one
results[0].headerCircuit name, register sizes, global phase, metadata
python
from qiskit import QuantumCircuit

from menos.qiskit import MENOSBackend

qc = QuantumCircuit(2, 2, name="bell")
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])

result = MENOSBackend().run(qc, shots=100, seed_simulator=4).result()
print(result.backend_name, result.results[0].seed_simulator, result.time_taken >= 0)
assert result.success
assert result.backend_name == "menos"
assert result.results[0].seed_simulator == 4
assert result.results[0].header["name"] == "bell"

Counts and statevectors ​

See Counts and Statevectors.

The native Result ​

menos.run returns a different object, menos.Result, used by the native API:

PropertyTypeMeaning
countsdict[str, int]Hexadecimal bitstring keys ("0x3") to counts
statevectornumpy.ndarray or Nonecomplex128 amplitudes
expectation_valuecomplex or NoneThe expectation value, when one was requested
exactboolTrue if nothing was approximated
actual_state_bytesintPeak bytes the engine actually used
execute_secondsfloatTime executing the successful attempt
sample_secondsfloatTime drawing samples
explain()strThe plan report

It has no plan or replans attribute in Python. The plan and any replans are reported through explain() only.

Exactness ​

exact is always True for anything reachable from Python. See Exactness.

Released under the Apache-2.0 license. GitHub · PyPI