Metadata-Version: 2.1
Name: abrax
Version: 0.1.0
Summary: A Quantum Circuit DSL
Home-page: https://github.com/plutoniumm/abrax
Author: plutoniumm
License: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest ; extra == 'dev'
Requires-Dist: twine ; extra == 'dev'
Requires-Dist: wheel ; extra == 'dev'

## abraxas

A tiny DSL to compile to qiskit circuits. The goal is to speed up the time it takes to write small stupid circuits. Anything beyond a certain complexity should be written in qiskit directly.

[Qiskit](https://qiskit.org/) • [Abraxas](https://foundation.fandom.com/wiki/Abraxas_Conjecture) • [Issues](https://github.com/plutoniumm/abraxas/issues) • [Latest](https://github.com/plutoniumm/abraxas/releases/latest)

### Install
While not specified here you will need Qiskit since Abraxas takes in an initialized `QuantumCircuit` object to write to.
```py
pip install abraxas
```

### Examples
#### Fairly Complex
```python
from abrax import A
from qiskit import QuantumCircuit

qc = QuantumCircuit(5)
qc = A("""
  - H CX(4) RX(10)
  - H -    -
  - H -    CX(4)
  - H X    RY(55)
  - H -    -
  """, qc
)

# Should be equivalent to
from qiskit import QuantumCircuit

qc = QuantumCircuit(5)
qc.h([0, 1, 2, 3, 4])
qc.cx(0, 4)
qc.x(3)
qc.rx(10, 0)
qc.cx(2, 4)
qc.ry(55, 3)
qc.measure_all()
```

### Simple
```python
from abrax import A
from qiskit import QuantumCircuit

qc = QuantumCircuit(2)
# This will apply H, H to 0-qubit & 1-qubit
# Then a CX on 0-qubit (as target) with 1-qubit as control
qc = A("""
  - H CX(1)
  - H -
  """, qc
)
```

### Syntax
- Note All lines must start with a `-` or `|>` (continuation operator `NotImplemented` yet)
- Everything else is a comment
- Case insensitive

**Passing Config**
```python
qc = A("""
- H CX(1)
- H -
""", qc,
config={
  "measure": False,
})
```

| Key | Type (Default) | Description |
| --- | --- | --- |
| `measure` | `bool` (`True`) | Whether to measure all qubits at the end of the circuit |
