Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/itsubaki/quasar
Quantum Computation Simulator as a Service
https://github.com/itsubaki/quasar
quantum-computation quantum-computing
Last synced: 9 days ago
JSON representation
Quantum Computation Simulator as a Service
- Host: GitHub
- URL: https://github.com/itsubaki/quasar
- Owner: itsubaki
- License: mit
- Created: 2022-05-03T05:29:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-30T04:08:36.000Z (23 days ago)
- Last Synced: 2024-11-30T04:26:06.233Z (23 days ago)
- Topics: quantum-computation, quantum-computing
- Language: Go
- Homepage: https://pkg.go.dev/github.com/itsubaki/quasar
- Size: 332 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# quasar
Quantum Computation Simulator as a Service
## Deploying to Cloud Run
```shell
$ export PROJECT_ID=YOUR_GOOGLE_CLOUD_PROJECT_ID
$ export LOCATION=YOUR_GOOGLE_CLOUD_LOCATION
$ export IMAGE=${LOCATION}-docker.pkg.dev/${PROJECT_ID}/quasar/app
$
$ gcloud builds submit --config cloudbuild.yaml --substitutions=_IMAGE=${IMAGE},_TAG=latest .
$ gcloud run deploy --image ${IMAGE} --set-env-vars=PROJECT_ID=${PROJECT_ID} quasar
```## Example
```shell
$ cat testdata/bell.qasm
OPENQASM 3.0;gate h q { U(pi/2.0, 0, pi) q; }
gate x q { U(pi, 0, pi) q; }
gate cx c, t { ctrl @ x c, t; }qubit[2] q;
reset q;h q[0];
cx q[0], q[1];
``````shell
$ curl -s $(gcloud run services describe quasar --format 'value(status.url)') -X POST -F file=@testdata/bell.qasm | jq .
{
"state": [
{
"amplitude": {
"real": 0.7071067811865476,
"imag": 0
},
"probability": 0.5000000000000001,
"int": [
0
],
"binary_string": [
"00"
]
},
{
"amplitude": {
"real": 0.7071067811865475,
"imag": 0
},
"probability": 0.4999999999999999,
"int": [
3
],
"binary_string": [
"11"
]
}
]
}
``````shell
$ curl -s -H $(gcloud run services describe quasar --format 'value(status.url)')/shor/15 | jq .
{
"N": 15,
"a": 13,
"m": "0.010",
"p": 3,
"q": 5,
"s/r": "1/4",
"seed": -1,
"t": 3
}
```