Skip to main content

QC Executor

QC Executor

This library provides an abstraction for quantum circuits and operators that can be run on different backends using an Executor object.

Installation

Core Installation

QC Executor can be installed with only the backends you need. By default, only Qiskit (used as the common intermediate representation) is required:

pip install qc-executor

Backend-Specific Installation

Install QC Executor with specific backends:

# 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 Pauli Propagation backend
pip install qc-executor[pauli_propagation]

# Install with all backends
pip install qc-executor[all]

# Install multiple specific backends
pip install qc-executor[pennylane,qulacs,pauli_propagation]

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 shots
  • seed (int, optional): Random seed for reproducibility
  • log_file (str, optional): Path to log file
  • log_level (str, optional): Logging level ("DEBUG", "INFO", "WARNING", "ERROR")
  • caching (bool, optional): Enable result caching
  • cache_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

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

qc_executor-0.1.0.tar.gz (353.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

qc_executor-0.1.0-py3-none-any.whl (159.1 kB view details)

Uploaded Python 3

File details

Details for the file qc_executor-0.1.0.tar.gz.

File metadata

  • Download URL: qc_executor-0.1.0.tar.gz
  • Upload date:
  • Size: 353.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for qc_executor-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2461090932fa1d75fdd21a1984324ad3b05ffd06a70ca3328fba0ec0e5ced10d
MD5 3ed9ba6d16492bd9e1924ece116f2ffe
BLAKE2b-256 4685bbeda42711488c55e7f585780be11df276f70b78f0c68e814080d1c01345

See more details on using hashes here.

Provenance

The following attestation bundles were made for qc_executor-0.1.0.tar.gz:

Publisher: publish.yml on flaqship/qc-executor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file qc_executor-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: qc_executor-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 159.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for qc_executor-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d26e629819ed5ddec3d3dd277593a71a964e2f8bf566606004cde808d4178783
MD5 bd7df1f5f0f83a68aa1517e4b3305421
BLAKE2b-256 22b69ac432fbdf9e1d4d8fb6cc124584e1cc6096c720860cb8cb351ebcf56f3e

See more details on using hashes here.

Provenance

The following attestation bundles were made for qc_executor-0.1.0-py3-none-any.whl:

Publisher: publish.yml on flaqship/qc-executor

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page