Your first circuit on MENOS, in five minutes
Install the package, run a Bell state through the Qiskit adapter, and ask the planner how it decided to run it. No GPU or configuration required.
MENOS plugs into Qiskit as a native BackendV2, so if you already have a Qiskit circuit you can run it on MENOS without changing it. This walkthrough takes about five minutes and needs nothing more than Python.
1. Install
MENOS is a Python package. The qiskit extra pulls in the adapter:
pip install "menos[qiskit]"
Check that it imported:
python -c "import menos; print(menos.__version__)"
If that prints a version number, you are ready. If not, the installation guide and requirements pages cover platforms and common problems.
2. Run a Bell state
A Bell pair is the smallest circuit with entanglement in it: a Hadamard on one qubit, then a CNOT onto the other. Build it in Qiskit as usual, then hand it to MENOSBackend:
from qiskit import QuantumCircuit
from menos.qiskit import MENOSBackend
qc = QuantumCircuit(2, 2)
qc.h(0)
qc.cx(0, 1)
qc.measure([0, 1], [0, 1])
backend = MENOSBackend()
result = backend.run(qc, shots=1000, seed_simulator=7).result()
counts = result.get_counts()
print(counts)
# A Bell pair only ever yields 00 or 11, and every shot is accounted for.
assert set(counts) <= {"00", "11"}
assert sum(counts.values()) == 1000
The two assertions are the point of the exercise. A Bell pair should never produce 01 or 10, and all 1,000 shots should land somewhere. Passing the seed_simulator makes the run reproducible, so the same seed always gives the same counts.
3. See what the planner did
Behind that run call, MENOS did not just allocate a statevector. It analysed the circuit, priced the candidate engines, and picked the cheapest one that could run it exactly.
For a circuit this small, several engines are feasible. Because a Bell circuit uses only Clifford gates, the stabilizer engine is usually the cheapest. The native API's explain() prints the full report, listing every candidate it considered, the one that won, and why. The planner explanation example shows the output line by line.
4. Where to go next
- Expectation values: MENOS also ships an
EstimatorV2, and expectation-value jobs open up extra strategies such as Pauli propagation and circuit cutting. See Estimator. - Bigger circuits: the MPS example runs a 100-qubit brickwork circuit that no statevector simulator could hold in memory.
- Budgets: set a time budget and watch MENOS monitor and replan a run.
- GPUs: with a CUDA device available, dense jobs move to it when the calibrated cost model says it will be faster. See CPU vs CUDA.
For the reasoning behind the planner, read Plan first, then simulate.
