Note
This is a community-maintained fork of a MIT-licensed student project in the Effective Programming with Effects course in winter semester 2025/2026. Be warned that this is not an officially endorsed project, the code in this repository may be not idiomatic Effekt.
The original repository is https://github.com/JoshuaSchlucke/AnsatzLite
AnsatzLite is a small internal DSL and runtime for the Quantum alternating operator ansatz, written in Effekt. It showcases algebraic effects by separating pure problem definitions from effectful backends.
Using Nix (recommended):
nix build
./result/bin/ansatz --helpWithout Nix (dev):
effekt src/main.effekt -- --helpFor frequent use, add the binary to your PATH
Show all flags:
ansatz --helpRun a small MaxCut instance:
ansatz --problem maxcut --graph tiny --p 1 --gammas 0.2 --betas 0.4Run SAT with a generated k-SAT formula:
ansatz --problem sat --formula k3-10-6 --p 1 --gammas 0.2 --betas 0.4Enable optimization:
ansatz --opt grid --opt-steps 5 --opt-verbose --p 1 --problem maxcut --graph tinyRun all tests:
effekt tests/*- User guide: docs/USER_GUIDE.md
- Developer guide: docs/DEVELOPER_GUIDE.md