A cross-platform library for Swift/Kotlin/C#/Python, surfacing features of the Q# compiler and resource estimator.
| Swift | .NET | Kotlin | Python | |
|---|---|---|---|---|
| Package | Swift Package | Nuget | N/A | Wheel |
| Manual Integration | Bindings + XCFramework Bindings + native library | Bindings + native library | Bindings + native library | Bindings + native library |
| Platforms | macOS arm64 iOS |
Windows x64 Windows arm64 (not via Nuget) Linux x64 Linux arm64 (not via Nuget) macOS arm64 |
Windows x64 Linux x64 macOS arm64 |
Windows x64 Windows arm64 Linux x64 Linux arm64 macOS arm64 |
Build the Swift Package (arm64 Mac required).
./build_swift.shThis builds:
- the Swift Package under
platforms/swift/QSharp.Bridge - XCFramework under
artifacts/swift/qsharp_bridge_framework.xcframework
Now run the Swift console app:
cd examples/swuft/console
./run.shInstall UniFFI C# bindings generator
cargo install uniffi-bindgen-cs --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag v0.10.0+v0.29.4Build the Nuget package for your platform:
cargo build --releaseNow run the .NET console app:
cd examples/csharp/console
dotnet run -c ReleaseGo the Kotlin sample and run it from there:
cd samples/kotlin
./run.shFirst build the Wheel:
cd platforms/python/qsharp-bridge
python -m pip install --upgrade pip setuptools wheel
python setup.py sdist bdist_wheelYou can then use the Jupyter Notebooks:
cd samples/python/jupyterMake sure you have created a Virtual Environment or activated a Conda environment, and install the dependencies (including the Wheel):
pip install -r requirements.txtNow open the Notebook and run the cells.
✅ Tested on Windows arm64
✅ Tested on Windows x64
✅ Tested on Linux arm64
✅ Tested on Linux x64
✅ Tested on macOS arm64
✅ Tested on macOS arm64.
✅ Tested on iPadOS
✅ Tested on iOS
✅ Tested on macOS arm64.
✅ Tested on Windows arm64
✅ Tested on macOS arm64