Metadata-Version: 2.4
Name: quantag
Version: 0.3.0
Summary: Quantag Quantum Virtual Machine backend for Qiskit
Author-email: Quantag IT Solutions GmbH <info@quantag-it.com>
License: MIT License
        
        Copyright (c) 2025 QuanTag
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://quantum.quantag-it.com
Project-URL: Source, https://github.com/quantag/quantag-python
Keywords: quantum,qiskit,simulator,cudaq
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Topic :: Scientific/Engineering :: Physics
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: qiskit>=1.0.0
Requires-Dist: requests>=2.0.0
Dynamic: license-file

QuantagVM
=========

Quantag Quantum Virtual Machine (QVM) backend for Qiskit.

Installation
------------

You can install the package from PyPI:

```bash
pip install quantag
```

Usage
-----

### Synchronous workflow (default)

```python
from qiskit import QuantumCircuit
from quantag.vm import QuantagVM

# Create a simple circuit
qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()

# Run it on QuantagVM (sync mode, results returned immediately)
backend = QuantagVM(api_key="YOUR_API_KEY",
                    backend_type="cudaq",
                    async_mode=False)

job = backend.run(qc, shots=100)
result = job.result()
print(result.get_counts())
```

### Asynchronous workflow

In async mode, jobs are submitted to the server and you can poll for status.

```python
from qiskit import QuantumCircuit
from quantag.vm import QuantagVM

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()

backend = QuantagVM(api_key="YOUR_API_KEY",
                    backend_type="cudaq",
                    async_mode=True)

job = backend.run(qc, shots=100)
print("Submitted async job:", job.job_id())
print("Initial status:", job.status())

# Wait until done and fetch results
result = job.result()
print("Async result:", result.get_counts())
```

### Environment variables

Instead of hardcoding parameters, you can set environment variables.

Linux / macOS:

```bash
export QUANTAG_API_KEY="YOUR_API_KEY"
export QUANTAG_SERVER="https://quantum.quantag-it.com/api5"
export QUANTAG_BACKEND="cudaq"
export QUANTAG_ASYNC=1
```

Windows PowerShell:

```powershell
setx QUANTAG_API_KEY "YOUR_API_KEY"
setx QUANTAG_SERVER "https://quantum.quantag-it.com/api5"
setx QUANTAG_BACKEND "cudaq"
setx QUANTAG_ASYNC 1
```

Then in Python you can simply do:

```python
from qiskit import QuantumCircuit
from quantag.vm import QuantagVM

qc = QuantumCircuit(2)
qc.h(0)
qc.cx(0, 1)
qc.measure_all()

backend = QuantagVM()  # picks up env vars automatically
job = backend.run(qc, shots=1000)
print(job.result().get_counts())
```

License
-------

MIT License. See LICENSE file for details.
