QC Executor
This library provides an abstraction for quantum circuits and operators that can be run on different backends using an Executor object.
The abstraction is framework-independent: circuits, operators and parameters are built on a compact columnar instruction store and SymPy, not on any quantum SDK. import qc_executor pulls in nothing but NumPy and SymPy, and every backend — Qiskit included — is an optional extra loaded on first use.
Installation
Core Installation
QC Executor can be installed with only the backends you need. The core install depends on NumPy and SymPy alone, and includes the pure-Python pauli_propagation backend:
pip install qc-executor
Backend-Specific Installation
Install QC Executor with specific backends:
# Install with Qiskit backend (statevector simulation)
pip install qc-executor[qiskit]
# Install with PennyLane backend
pip install qc-executor[pennylane]
# Install with Qulacs backend
pip install qc-executor[qulacs]
# Install with full Qiskit support (Aer simulator and IBM Runtime)
pip install qc-executor[qiskit-full]
# Install with all backends
pip install qc-executor[all]
# Install multiple specific backends
pip install qc-executor[qiskit,pennylane,qulacs]
Usage
Factory API (Recommended)
The Executor factory class provides a plugin-based interface for creating executors:
from qc_executor import Executor
# Create an executor for a specific backend
executor = Executor.create("qiskit", shots=1024, seed=42)
# List available backends
backends = Executor.available_backends()
print(backends) # ['qiskit', 'pennylane', 'qulacs', 'pauli_propagation']
# Create circuit and observable
from qc_executor import QuantumCircuit, QuantumOperator
circuit = QuantumCircuit(2)
circuit.h(0)
circuit.cx(0, 1)
observable = QuantumOperator.from_pauli_string("ZZ")
# Run computation
result = executor.expectation_value(circuit, observable)
print(result)
Backend Switching
You can easily switch between backends while preserving configuration:
# Create executor with specific configuration
qiskit_executor = Executor.create("qiskit", shots=1024, seed=42, caching=True)
# Switch to PennyLane backend with same configuration
pennylane_executor = qiskit_executor.switch_backend("pennylane")
# Switch with configuration overrides
qulacs_executor = qiskit_executor.switch_backend("qulacs", shots=2048)
Direct Import API (Alternative)
For backward compatibility, you can still import executors directly:
from qc_executor.qiskit import QiskitExecutor
from qc_executor.pennylane import PennyLaneExecutor
from qc_executor.qulacs import QulacsExecutor
# Create executor directly
executor = QiskitExecutor(shots=1024, seed=42)
Configuration Options
All executors support the following configuration parameters:
shots(int, optional): Number of measurement shotsseed(int, optional): Random seed for reproducibilitylog_file(str, optional): Path to log filelog_level(str, optional): Logging level ("DEBUG", "INFO", "WARNING", "ERROR")caching(bool, optional): Enable result cachingcache_dir(str, optional): Directory for caching (default: "cache")max_cache_size(int, optional): Maximum number of cached results (default: unlimited)
Backend Object Convention
When an executor accepts a backend-specific object (for example a Qiskit backend
instance or a PennyLane qml.devices.Device), the constructor parameter name is
backend.
from qc_executor.pennylane import PennyLaneExecutor
executor = PennyLaneExecutor(backend="default.mixed", shots=1000, seed=42)
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.
License
Metadata
Release files for qc-executor 0.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| qc_executor-0.2.1.tar.gz | 481.5 kB | With provenance | Details for qc_executor-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| qc_executor-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for qc_executor-0.2.1-py3-none-any.whl |
Total release size: 702.8 kB
Release files / qc_executor-0.2.1.tar.gz
| Download URL | qc_executor-0.2.1.tar.gz |
|---|---|
| Size | 481.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
26e7f2c1c619f5286ad0632ed75af6020106d50520d59a502aa06cee1b2e4896
|
|
BLAKE2b-256 checksum How to use checksums |
f6bdac28750eb8b83225dd6a9c92b01f1d247f0c3a8e9e7491fd9d055558fc93
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logRelease files / qc_executor-0.2.1-py3-none-any.whl
| Download URL | qc_executor-0.2.1-py3-none-any.whl |
|---|---|
| Size | 221.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9743eddeb6a206438ff2b6d4dccad900810f8fded34febea7ff37903b9f6002c
|
|
BLAKE2b-256 checksum How to use checksums |
5e5c735fd12e325b4dc880a7e5ad34f53f61891a9f9ce35678ebe209d89da337
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logSecurity for qc-executor 0.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for qc_executor-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 26, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.