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.sh
This 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.sh
Install UniFFI C# bindings generator
cargo install uniffi-bindgen-cs --git https://github.com/NordSecurity/uniffi-bindgen-cs --tag v0.9.1+v0.28.3
Build the Nuget package for your platform:
cargo build --release
Now run the .NET console app:
cd examples/csharp/console
dotnet run -c Release
Go the Kotlin sample and run it from there:
cd samples/kotlin
./run.sh
First build the Wheel:
cd platforms/python/qsharp-bridge
python -m pip install --upgrade pip setuptools wheel
python setup.py sdist bdist_wheel
You can then use the Jupyter Notebooks:
cd samples/python/jupyter
Make sure you have created a Virtual Environment or activated a Conda environment, and install the dependencies (including the Wheel):
pip install -r requirements.txt
Now 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