Metadata-Version: 2.4
Name: qubex-simulator
Version: 1.5.0rc4
Summary: Qubex quantum system simulation utilities
Author: Akinori Machino
License-Expression: Apache-2.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: networkx>=2.7
Requires-Dist: numpy>=1.22
Requires-Dist: plotly>=5.23
Requires-Dist: qctrl-visualizer>=8.0
Requires-Dist: qutip[runtime-compilation]>=5.0.1
Requires-Dist: qubex-core==1.5.0rc4
Requires-Dist: qubex-pulse==1.5.0rc4
Requires-Dist: qubex-visualizer==1.5.0rc4
Requires-Dist: scipy>=1.0
Requires-Dist: typing_extensions>=4.5
Dynamic: license-file

# qubex-simulator

PyPI distribution: `qubex-simulator`. Python import: `qxsimulator` (unchanged).

```bash
pip install "qubex-simulator==1.5.0rc4"
```

`qxsimulator` is the quantum system simulation layer extracted from the Qubex project. It contains quantum system models, control signal definitions, and simulation utilities that higher-level packages like `qubex` build on.

## Relationship to qubex

- `qxsimulator` is a standalone package with no dependency on `qubex`.
- `qubex` depends on `qxsimulator` and provides the full experiment framework (backend, measurement, etc.).
- If you only need simulation utilities, install `qubex-simulator` directly.

## Requirements

- Python 3.10 or higher

## Installation

```bash
# pip
pip install "qubex-simulator @ git+https://github.com/amachino/qubex.git@v1.5.0rc4#subdirectory=packages/qxsimulator"

# uv
uv pip install "qubex-simulator @ git+https://github.com/amachino/qubex.git@v1.5.0rc4#subdirectory=packages/qxsimulator"
```

## Gate targets and fidelity spaces

Build target operations by object label. Named static gates include the Qubex
Clifford names, common one- and two-qubit gates, `ZX90`, `BSWAP`, and
`SQRT_BSWAP`. Build parameterized operations with a Hermitian generator and
`gates.rotation()`.

```python
import numpy as np

from qxsimulator import QuantumSystem, Transmon, gates

q04 = Transmon(label="Q04", dimension=3, frequency=5.0)
q01 = Transmon(label="Q01", dimension=3, frequency=5.2)
system = QuantumSystem(objects=[q04, q01])

cz = system.unitary({"Q04-Q01": "CZ"})
ef_x = system.unitary({"Q04": gates.X}, levels={"Q04": (1, 2)})
exchange = gates.rotation((gates.XX + gates.YY) / 2, np.pi / 2)
```

`QuantumSystem.unitary()` embeds each gate in the full physical Hilbert space
and leaves unselected levels unchanged. Fidelity methods evaluate the
computational subspace by default. Pass `levels="full"` for the complete
physical space or a mapping such as `levels={"Q04": (1, 2)}` to override the
evaluated levels of selected objects. Fidelity methods also accept the labeled
gate mapping directly as `target_unitary`; a level mapping then controls both
target embedding and evaluation.

`gates.rotation(generator, angle)` evaluates
`exp(-1j * angle * generator / 2)`. The generator expression therefore owns
the interaction normalization and sign.

## pyproject.toml

```toml
[project]
dependencies = [
  "qubex-simulator @ git+https://github.com/amachino/qubex.git@v1.5.0rc4#subdirectory=packages/qxsimulator",
]
```

## Development

```bash
git clone -b develop https://github.com/amachino/qubex.git

cd qubex/packages/qxsimulator

uv sync
```
