Skip to content

LocalDigitalSimulator

from cascaqit import LocalDigitalSimulator

LocalDigitalSimulator

LocalDigitalSimulator(
    seed: int | None = None,
    max_qubits: int = 4,
    target_id: str = "local.digital_simulator",
    created_at: str | None = None,
)

Reference state-vector simulator for direct Digital runs. Use LocalBackend for the current resource-planned scalable path; this entry point is retained for small reference executions and does not define the backend’s supported scale. Memory grows exponentially with qubit count. It does not expose the unified backend’s noise, scans or resource planning. seed controls sampling; target_id and created_at identify the result’s origin.

from cascaqit import Circuit, LocalDigitalSimulator

program = Circuit(1).x(0).measure_all().to_program()
result = LocalDigitalSimulator(seed=7).run(program, shots=32)
assert result.counts == {"1": 32}

Use LocalBackend for the unified job interface.

run

run(
    program: DigitalProgramIR,
    *,
    shots: int = 1000,
    config: SimulatorConfigIR | None = None,
) -> ResultIR

Execute DigitalProgramIR synchronously and return ResultIR; export a Circuit with to_program() first. Evolution starts in the all-zero state, followed by terminal sampling. shots=0 disables sampling. A supplied SimulatorConfigIR replaces the defaults from shots and the constructor seed. Some program-validation failures return a result with error diagnostics, so inspect diagnostics; invalid types and algorithm-selection errors can also raise exceptions.