> ## Documentation Index
> Fetch the complete documentation index at: https://dynex.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Quickstart

> Run your first quantum computation in under 5 minutes

## Prerequisites

* Python 3.11+
* A Dynex SDK key ([get one at dynexcoin.org](https://dynexcoin.org))

## Install

```bash theme={null}
pip install dynex
```

## Configure credentials

Set your SDK key as an environment variable, or create a `.env` file in your project root:

```bash theme={null}
# .env
DYNEX_SDK_KEY=your_sdk_key_here
DYNEX_GRPC_ENDPOINT=quantum-router-engine-grpc.hz.dynex.co:3000
```

<Tip>
  Install `python-dotenv` to auto-load `.env` files: `pip install python-dotenv`
</Tip>

## Your first annealing job

The following example creates a simple Binary Quadratic Model and samples it on the Dynex neuromorphic GPU network:

```python theme={null}
import dynex
import dimod
from dynex import DynexConfig, ComputeBackend

# Build a simple BQM: minimize x0 + x1 with interaction penalty
bqm = dimod.BinaryQuadraticModel(
    {0: -1.0, 1: -1.0},
    {(0, 1): 2.0},
    0.0,
    'BINARY'
)

# Configure to use Dynex neuromorphic GPU chips
config = DynexConfig(compute_backend=ComputeBackend.GPU)

# Wrap model and create sampler
model = dynex.BQM(bqm)
sampler = dynex.DynexSampler(model, config=config, description="My first Dynex job")

# Sample
sampleset = sampler.sample(num_reads=1000, annealing_time=200)

# Inspect results
best = sampleset.first
print(f"Best sample:  {best.sample}")
print(f"Best energy:  {best.energy}")
```

<Note>
  `ComputeBackend.GPU` is the primary Dynex backend — your job runs on Dynex's own neuromorphic GPU chips distributed globally. For offline testing without credentials, use `ComputeBackend.LOCAL` with the local solver binary.
</Note>

## Your first quantum circuit

Run a PennyLane circuit on Dynex using the `DynexCircuit` class:

```python theme={null}
import pennylane as qml
from dynex import DynexConfig, ComputeBackend, DynexCircuit

# Define a simple 2-qubit circuit
def bell_circuit(params):
    qml.Hadamard(wires=0)
    qml.CNOT(wires=[0, 1])
    return qml.state()

# Configure QPU backend
config = DynexConfig(
    compute_backend=ComputeBackend.QPU,
    qpu_model='apollo_rc1'
)

dynex_circuit = DynexCircuit(config=config)
result = dynex_circuit.execute(
    bell_circuit,
    params=[],
    wires=2,
    method='measure'
)
print("Circuit result:", result)
```

## Next steps

<CardGroup cols={2}>
  <Card title="Defining Models" icon="cube" href="/annealing/models">
    Learn about BQM, CQM, and DQM models
  </Card>

  <Card title="Sampling" icon="wave-sine" href="/annealing/sampling">
    Sampling parameters and backends explained
  </Card>

  <Card title="Compute Backends" icon="server" href="/annealing/backends">
    LOCAL, CPU, GPU, and QPU backends
  </Card>

  <Card title="Circuit Examples" icon="microchip" href="/circuits/examples">
    Grover's, Shor's, QFT, and more
  </Card>
</CardGroup>
