Quantum computing
Quantum programming in AEL, the Agent Engineering Language, will come from optional packages. Quantum circuits will be typed, with standard and custom gates. Circuits will export to OpenQASM and QIR, with circuit lowering and routing, and hybrid agent workflows will let an agent propose a circuit, validate it, simulate it, optionally run it on hardware and check the result.
Status
Planned for AEL Beta 0.0.1. AEL is not available yet.
A program that does not use these packages will carry none of their code. Building a circuit will need no simulator, no account and no network.
Package names on this page are preview naming and may change before launch.
The packages
| Package | What it will provide |
|---|---|
quantum/circuit | Circuits: qubit and classical-bit handles, operations, measurements, observables, parameters and validation. |
quantum/gates/standard | Identity, Pauli, Hadamard, phase and rotation gates, their adjoints, controlled gates, swap and common multi-qubit gates. |
quantum/sim/statevector, quantum/sim/density-matrix, quantum/sim/stabilizer, quantum/sim/tensor-network | Simulators, each for the circuits it can handle. |
quantum/compile/openqasm, quantum/compile/qir | Export to OpenQASM and QIR. |
quantum/algorithms/… | Algorithm families, such as variational optimization, search, error mitigation and error correction. |
quantum/control/pulse | Pulse-level control, for hardware that offers it. |
Optional packages will cover quantum algorithms, error mitigation and correction, quantum machine learning and quantum chemistry. You will add each one on its own with ael pack add (command names may change before launch):
ael pack add quantum/circuit
ael pack add quantum/sim/statevector
ael pack add quantum/compile/openqasm
Typed circuits
- Qubits will be handles. A reference to a released, out-of-range or other circuit's qubit will be refused.
- Gates will declare themselves. Each gate will state its number of targets and controls, its parameters and their units, and its matrix or decomposition. The standard gates will follow one published convention for qubit order, phase and angle units.
- Custom gates will be checked. A custom gate will bring a decomposition or a matrix. A matrix of the wrong shape, one that is not unitary, a non-finite parameter or an endlessly recursive definition will be refused.
- Measurement will be explicit. Measurement, reset and the mapping of results to classical bits will be part of the circuit, and will never be treated as reversible gates.
- Parameters will be bound before submission. A circuit with an unbound parameter will fail before any work is requested.
- Results will have kinds. Statevectors, density matrices, samples, counts and expectation estimates will be different types. A run on hardware will never pretend to return a statevector.
Simulators that state their limits
Quantum simulators (statevector, density-matrix, stabilizer and tensor-network) will state their cost and precision limits:
- A statevector needs 2^n complex amplitudes for n qubits, and a density matrix 4^n entries. The memory a simulation needs will be computed before it starts, and a simulation that will not fit will be refused instead of running out of memory.
- The stabilizer simulator will accept only the gates it can simulate efficiently and refuse the rest unless you select a fallback; it will never fall back silently to an exponential method.
- The tensor-network simulator will report the approximation it made.
- Seeds will make sampling repeatable where the method allows it.
Export, lowering and routing
Export will target a declared version and subset of OpenQASM and a declared QIR profile; anything outside them will be refused unless a declared extension policy keeps it. Lowering for a backend will map logical qubits to physical ones, respect the device's connectivity, decompose into the gates it accepts, and report the depth, gates and swaps it added. It will never silently replace a hardware conditional with feedback from the host, drop a measurement, or switch from hardware to a simulator.
Jobs on quantum hardware
Quantum jobs will run asynchronously on quantum hardware providers, with budgets, cancellation and tenant-scoped credentials. They will use your own account with a quantum hardware provider, an outside system that AEL talks to through its own interface.
- Clear states. A job will move through validated, submitted, queued, running, result available, failed, cancellation requested and cancelled. When the outcome cannot be known, it will be reported as unknown.
- No blind resubmission. A submission can be billable. If an acknowledgement is lost, the job will be reconciled with the provider, never simply submitted again.
- Separate budgets. Qubits, shots, batch size, device time, simulation time, cost and concurrency will each have their own limit, apart from model token budgets.
- Authority will stay with you. An agent will be able to choose among the backends you authorized, but a model's answer will never be able to grant a credential, a device or spending.
- Honest usage. Reports will give shots, circuits, queue time, simulation time, the device time the provider reports and the cost with its source. Usage a provider does not report will stay unknown, never zero.
Adding or installing a package will never contact a provider or submit a job.
Hybrid agent workflows
# agents/circuit_designer.agent.ael
agent circuit_designer(input: Goal) -> CheckedResult {
config {
nodes: [designer = propose_circuit, validator = validate_circuit,
simulator = simulate, checker = check_result];
edges: [proposal_to_validation(designer, validator),
validation_to_simulation(validator, simulator),
counts_to_check(simulator, checker)];
starts: [designer];
completion: checker.result;
}
}
The model-driven propose_circuit will suggest a circuit; deterministic nodes will validate it, simulate it and check the result against your criteria. A step that runs the circuit on hardware will be able to follow the simulation, within its own budget.
Honest limits
Mitigated results are not error-corrected results, and the packages will keep the two apart. Repeating an experiment on hardware need not reproduce the same samples, so comparisons are statistical. A loop in your program that submits one job after another is not fast feedback inside a single hardware run. Quantum machine learning will not be promised to improve accuracy or speed. Each package will state the circuits, gates and backends it covers.