Metadata-Version: 2.4
Name: devqubit-cudaq
Version: 0.1.12
Summary: devqubit adapter for CUDA-Q
Author: devqubit
License-Expression: Apache-2.0
License-File: LICENSE
Keywords: cudaq,experiment-tracking,nvidia,quantum
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: <3.14,>=3.11
Requires-Dist: cuda-quantum-cu12<0.14.0,>=0.13.0
Requires-Dist: cudaq<0.14.0,>=0.13.0
Requires-Dist: devqubit-engine<0.2.0,>=0.1.12
Description-Content-Type: text/markdown

# devqubit-cudaq

[![PyPI](https://img.shields.io/pypi/v/devqubit-cudaq)](https://pypi.org/project/devqubit-cudaq/)

NVIDIA CUDA-Q adapter for [devqubit](https://github.com/devqubit-labs/devqubit) — automatic kernel capture, target snapshots, and result logging for CUDA-Q `sample` and `observe` workflows.

> [!IMPORTANT]
> **This is an internal adapter package.** Install via `pip install "devqubit[cudaq]"` and use the `devqubit` public API.

## Installation

```bash
pip install "devqubit[cudaq]"
```

## Usage

### Sampling

```python
import cudaq
from devqubit import track

@cudaq.kernel
def bell():
    q = cudaq.qvector(2)
    h(q[0])
    x.ctrl(q[0], q[1])
    mz(q)

with track(project="cudaq-experiment") as run:
    executor = run.wrap(cudaq)
    result = executor.sample(bell, shots_count=1000)
```

### Observe (Expectation Values)

```python
from cudaq import spin

hamiltonian = spin.z(0)

with track(project="cudaq-vqe") as run:
    executor = run.wrap(cudaq)
    result = executor.observe(bell, hamiltonian)
    print(result.expectation())
```

## What's Captured

| Artifact | Kind | Role |
|---|---|---|
| Kernel JSON | `cudaq.kernel.json` | `program` |
| Kernel diagram | `cudaq.kernel.diagram` | `program` |
| MLIR (Quake) | `cudaq.kernel.mlir` | `program` |
| QIR | `cudaq.kernel.qir` | `program` |
| Counts / expectation | `result.cudaq.output.json` | `result` |
| Execution envelope | `devqubit.envelope.json` | `envelope` |

## Documentation

See the [Adapters guide](https://devqubit.readthedocs.io/en/latest/guides/adapters.html) for details on `observe` workflows, performance tuning, and spin operator capture.

## License

Apache 2.0
