Metadata-Version: 2.3
Name: pennylane-oqcqcaas
Version: 0.2.2
Summary: PennyLane Plugin for OQC QCaaS
License: BSD-3-Clause
Author: Owen Arnold
Author-email: oarnold@oxfordquantumcircuits.com
Requires-Python: >=3.10,<3.13
Classifier: License :: OSI Approved :: BSD License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: oqc-qcaas-client (>=3.20)
Description-Content-Type: text/markdown

# pennylane-oqc
PennyLane plugin for OQC QCaaS devices

## Build and Install

```
poetry build
```

## Developer Setup

```
poetry install
```

### ExperimentalConfig
ExperimentalConfig is a drop-in replacement for CompilerConfig that lets you attach backend-specific (Toshiko-fermioniq simulator) settings—like enabling noise, supplying a noise model, or setting a tensor-network bond dimension—without changing the rest of your workflow.
It forwards standard compiler fields (e.g., repeats, results_format, optimizations) and adds noise, bond_dimension, and noise_model.
Install the extra dependencies with: pip install 'oqc-qcaas-client[experimental]'. This will install extra `qcshared` package which is necessary for the noise-model definition

```python
from qcaas_client.client import OQCClient, QPUTask, ExperimentalConfig
from compiler_config.config import QuantumResultsFormat, Tket, TketOptimizations

client = OQCClient(url=OQC_URL, authentication_token=OQC_AUTH_TOKEN)
opts = Tket(); opts.tket_optimizations = TketOptimizations.Two

config = ExperimentalConfig(
    repeats=1000,
    results_format=QuantumResultsFormat().binary_count(),
    optimizations=opts,          # same as CompilerConfig
    noise=True,                  # enable noisy execution
    bond_dimension=64,           # TN simulator control (if supported)
    noise_model=None,            # or a NoiseModel/dict
)

task = QPUTask(program=openqasm_str, config=config, qpu_id=os.environ["OQC_DEVICE"])
result = client.schedule_tasks([task], qpu_id=os.environ["OQC_DEVICE"])
```
### Test Runs

Note tests look for `.env` file from which to source these env variables that are required for the plugin.
Suggest placing this file in the root of the test directory.

* "OQC_URL"
* "OQC_DEVICE"
* "OQC_AUTH_TOKEN"

```
poetry run python -m pytest
```

