> ## Documentation Index
> Fetch the complete documentation index at: https://quantura.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Simulate an OpenQASM 2 circuit

> Get ideal probabilities and sampled counts from Quantura’s bounded CPU simulator.

Call `quantura_quantum_simulate` over [Quantura MCP](https://quantura.mintlify.site/docs/mcp.md), or POST to `/api/v1/quantum/simulate` using a JSON body. The web lab uses the public `/api/quantum/simulate` endpoint. Both use Quantura’s MIT-licensed CPU implementation.

```json theme={null}
{"qasm":"OPENQASM 2.0; include \"qelib1.inc\"; qreg q[2]; creg c[2]; h q[0]; cx q[0],q[1]; measure q -> c;","shots":1024}
```

Use one quantum register and optionally one classical register. Gates include `h`, `x`, `y`, `z`, `s`, `sdg`, `t`, `tdg`, `rx`, `ry`, `rz`, `cx`, `cz`, and `swap`. Rotations accept radians and simple fractions of π such as `pi/2`. Place measurements after all gates. Without measurements, the simulator reads all qubits in the computational basis. Bit zero appears at the right of the output string.

The Bell example returns ideal probabilities of 0.5 for `00` and `11`. Sample counts vary from run to run. Inputs beyond the supported syntax or limits receive a clear error.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.