feat(backends): allow statevector simulation via use_statevector flag#56
Open
dlyongemallo wants to merge 20 commits into
Open
feat(backends): allow statevector simulation via use_statevector flag#56dlyongemallo wants to merge 20 commits into
use_statevector flag#56dlyongemallo wants to merge 20 commits into
Conversation
Introduce a framework-agnostic backend abstraction layer: - `GateType` enum covering all gates used by quantumaudio schemes - `GateOp` frozen dataclass for a single gate operation - `CircuitSpec` with fluent builder API and Mottonen state-prep decomposition for non-negative real state vectors into RY + CX gates - `UnifiedResult` normalising execution output across backends, with `to_qiskit_result()` bridge for backward compatibility - Backend `ABC` and `BackendRegistry` singleton for provider discovery - `is_available()` and `require()` helpers for optional dependencies - Tests covering the above
Implement the `Backend` interface for Qiskit/AerSimulator, translating `CircuitSpec` to `QuantumCircuit` with named register reconstruction from metadata. Wire up the public API with `get_backend()` and `available_backends()` functions, and auto-register the Qiskit provider on import.
Implement the `Backend` interface for Google Cirq with automatic registration when `cirq` is installed. Cirq is added as an optional dependency under the `[cirq]` extras group.
…Qiskit types Add `CircuitSpec` and `UnifiedResult` branches to `get_counts()`, `get_metadata()`, and `pick_key_from_instance()` in `results.py`. Update `draw_circuit()` in preview.py to convert `CircuitSpec` to `QuantumCircuit` for visualisation. All existing Qiskit-only code paths are preserved.
… compat BREAKING CHANGE: `encode()` now returns `CircuitSpec` instead of `QuantumCircuit`.
BREAKING CHANGE: The `execute_function` parameter is removed from all scheme `decode()` methods, as it is redundant with the backend system. The `ExecuteFunction` protocol is removed from `quantumaudio.utils.execute`. The backend parameter and the lower-level `decode_counts()`/`decode_result()` methods cover all use cases.
Runs `ruff check` plus `pytest` across Python 3.9-3.12 with the `cirq`, `pennylane`, and `cudaq` extras installed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #55.
Closes #40.