Skip to content

Common Errors ​

The mistakes people make first, with the messages you will see.

AttributeError: Option 'X' is not valid for this backend ​

Symptombackend.run(qc, time_budget_seconds=1.0) raises AttributeError
CauseMENOSBackend accepts only shots, seed_simulator and want_statevector
SolutionUse those three. Time and memory budgets are available through the native API

ValueError: MENOSBackend.run() does not support batching ​

Symptombackend.run([qc1, qc2]) fails
CauseOne circuit per call
SolutionCall run once per circuit

TypeError: MENOSBackend.run() expects a QuantumCircuit ​

SymptomYou passed something other than a circuit
SolutionPass a qiskit.QuantumCircuit

My counts keys have leading zeros ​

SymptomKeys like 001 when you expected 1
CauseKeys are as wide as the classical register, and unwritten bits are 0
SolutionDeclare a register of the width you want, for example QuantumCircuit(3, 1). See Counts

My counts keys look like 0x3 ​

SymptomThe native API returns {'0x0': 507, '0x3': 493}
CauseThe native API keys counts by hexadecimal string
SolutionUse MENOSBackend for Qiskit's binary keys, or convert: format(int(key, 16), "b")

Results differ between runs ​

SymptomTwo runs of the same circuit give different counts
CauseMENOSBackend draws a fresh seed when seed_simulator is None
SolutionPass seed_simulator. See Determinism

The statevector is very large ​

SymptomSlow or refused jobs with want_statevector=True
CauseA statevector is 16 · 2ⁿ bytes
SolutionAsk for counts or an expectation value when that is enough. See Memory Errors

explain() labels run into values ​

Symptomcandidate 0strategy=direct_dense …
CauseLabels are padded to 11 characters, so a label of 11 or more runs into its value. It is the shipped format
SolutionNothing to fix. See Plan Explanation

InternalError ​

Symptommenos._core.InternalError: …
CauseA MENOS invariant was violated, or a case MENOS does not handle
SolutionCheck Exceptions for the known case (an all-identity observable) and the CUDA entries in Troubleshooting CUDA. Otherwise it is a bug worth reporting

ResourceExceededError for a job that used to work ​

SymptomA job now raises ResourceExceededError mentioning an observed runtime
CauseYou set a time budget, the run overran it, and no other plan fits
SolutionRaise the budget, or remove it. See Replanning

A replanned job took longer than its budget ​

SymptomTotal wall time is a multiple of time_budget_seconds
CauseThe budget bounds one attempt; abandoned attempts add to the total
SolutionThis is by design. See Time Budgets

See also ​

Installation Problems · Unsupported Circuits · Exceptions

Released under the Apache-2.0 license. GitHub · PyPI