This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
A Laravel package that bridges Laravel with Quantum Computing via AWS Braket and local simulators. Provides a fluent PHP API over Python-based quantum execution.
# Run all tests
./vendor/bin/pest
# Run a specific test file
./vendor/bin/pest tests/Unit/Circuit/GateTest.php
# Run a test suite
./vendor/bin/pest --testsuite Unit
./vendor/bin/pest --testsuite Feature
# Run a single test by name
./vendor/bin/pest --filter "it generates entropy"
# Install dependencies
composer installQuantum (Facade)
→ QuantumManager (multi-driver Manager pattern, like Cache/Session)
→ QuantumDevice (contract in Contracts/)
→ LocalSimulatorDriver | AwsBraketDriver (in Drivers/)
→ PythonBridge (Symfony Process, JSON stdin/stdout)
→ bin/python/*.py (Braket SDK)
→ CircuitResult (Arrayable, Jsonable)
Key flow: Quantum::circuit()->qubits(2)->h(0)->cnot(0,1)->measure()->run() builds a CircuitBuilder, which serializes to JSON, passes to a Python script via PythonBridge, executes on Braket, and returns a CircuitResult.
Driver switching: Quantum::driver('aws')->circuit()... like Cache::store('redis'). Default driver set via AETHER_DRIVER env var.
- PSR-12 strict,
declare(strict_types=1)in every PHP file - PHP 8.3+ features: readonly properties, named arguments, match expressions
- Laravel style naming: Driver files use
*Driversuffix (LocalSimulatorDriver,AwsBraketDriver). Contracts use semantic names withoutContractsuffix (Contracts\QuantumDevice). - Tests use Pest PHP, not raw PHPUnit classes. Use
it()/test()withexpect(). - Python scripts live in
bin/python/, notresources/. Each script is self-contained (reads JSON stdin, writes JSON stdout). - Exceptions all extend
AetherExceptionwith static factory methods (::fromPythonError(),::forDriver(), etc.) - PythonBridge only passes non-null env vars to preserve boto3 credential chain (IAM Roles).
- QPU safety: Drivers with
synchronous_safe: falsethrow on->run()to prevent HTTP timeouts. - EntropyGenerator::integer() uses rejection sampling on a 256-bit batch buffer — never modulo.
Published to config/aether.php. Key settings: default (driver name), python_path (Python executable), drivers (per-driver config with synchronous_safe flag).
Quantum::fake() replaces the manager with QuantumFake — same pattern as Http::fake(). Provides assertCircuitRan() and assertEntropyGenerated().