# Quirk Quantum Circuit Simulator — Attribution & License Notice

This directory (`public/quirk/`) hosts a self-contained build of **Quirk: Quantum Circuit Simulator** integrated into **QubitTürk (`qubitturk.org`)** under the **Apache License, Version 2.0**.

## Upstream Provenance

- **Project**: Quirk (`quirk-quantum-circuit-simulator`, v2.3.2)
- **Original Author**: **Craig Gidney**
- **Copyright**: **Copyright 2017 Google Inc.**
- **License**: **Apache License, Version 2.0** (full text in [`public/quirk/LICENSE`](./LICENSE) and [`vendor/quirk/LICENSE`](../../vendor/quirk/LICENSE))
- **Upstream Repository**: <https://github.com/Strilanc/Quirk>
- **Vendored Upstream `HEAD` Commit SHA**: `8833791294e642795c8717038e84940a74b19a64` (`2022-01-14 12:55:36 -0800`)
- **Vendored Pristine Source Path**: `vendor/quirk/`

## Apache License 2.0 Notice

```text
Copyright 2017 Google Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```

## Modification Disclosure (Apache 2.0 Section 4(b))

All upstream files under `vendor/quirk/src/` and `vendor/quirk/html/` are preserved unmodified from upstream commit `8833791294e642795c8717038e84940a74b19a64`. During compilation into `public/quirk/quirk.html` via `scripts/build-quirk.mjs`, QubitTürk appends a non-invasive integration layer providing:

1. Deterministic Node.js 22 ES module bundling (`esbuild`) and partial assembly with zero external network requests or analytics scripts.
2. QubitTürk toolbar & dialog visual harmony styling while preserving 100% of Quirk's WebGL simulation engine, 16-qubit capacity, 60+ gates, custom gate forge, displays, and `#circuit={...}` URL serialization.
3. Bilingual Turkish / English (`?lang=tr` and `?lang=en` + runtime `postMessage` switching) UI localization for top toolbar controls, modal dialogs, example circuit titles, and canvas toolbox headers/tooltips without altering standard quantum symbols (`H, X, Y, Z, S, T, CNOT, QFT, |0⟩, |1⟩`).
4. Same-origin `window.postMessage` parent-iframe bridge (`QT_LOAD_CIRCUIT`, `QT_REQUEST_CIRCUIT`, `QT_SET_LANG`, `QT_READY`, `QT_CIRCUIT_STATE`).

See [`public/quirk/QUBITTURK_CHANGES.md`](./QUBITTURK_CHANGES.md) for the complete technical modification log.
