-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9c5a1cf
commit 0ef7375
Showing
10 changed files
with
173 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Deploy to GitHub Pages | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
pages: write | ||
id-token: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout your repository using git | ||
uses: actions/checkout@v4 | ||
- name: Install, build, and upload your site | ||
uses: withastro/action@v2 | ||
|
||
deploy: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: github-pages | ||
url: ${{ steps.deployment.outputs.page_url }} | ||
steps: | ||
- name: Deploy to GitHub Pages | ||
id: deployment | ||
uses: actions/deploy-pages@v4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,28 @@ | ||
import { defineConfig } from 'astro/config'; | ||
import starlight from '@astrojs/starlight'; | ||
|
||
const sidebar = [ | ||
{ | ||
label: 'Guides', | ||
items: [ | ||
{ label: 'Welcome', link: '/welcome' }, | ||
{ label: 'toPrime', link: '/prime' }, | ||
], | ||
}, | ||
]; | ||
|
||
|
||
// https://astro.build/config | ||
export default defineConfig( { | ||
site: 'https://plutoniumm.github.io', | ||
base: import.meta.env.DEV ? '/' : '/abraxas/', | ||
integrations: [ | ||
starlight( { | ||
title: 'My Docs', | ||
title: 'Abraxas', | ||
social: { | ||
github: 'https://github.com/plutoniumm/abraxas', | ||
}, | ||
sidebar: [ | ||
{ | ||
label: 'Guides', | ||
items: [ | ||
// Each item here is one entry in the navigation menu. | ||
{ label: 'Example Guide', link: '/guides/example/' }, | ||
], | ||
}, | ||
{ | ||
label: 'Reference', | ||
autogenerate: { directory: 'reference' }, | ||
}, | ||
], | ||
sidebar, | ||
} ), | ||
], | ||
} ); |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,25 @@ | ||
--- | ||
title: Welcome to Starlight | ||
description: Get started building your docs site with Starlight. | ||
title: Welcome to Abraxas | ||
description: An IR for Quantum Circuits | ||
template: splash | ||
hero: | ||
tagline: Congrats on setting up a new Starlight project! | ||
image: | ||
file: ../../assets/houston.webp | ||
tagline: Interop between Quantum Circuits in different languages with low overhead | ||
actions: | ||
- text: Example Guide | ||
link: /guides/example/ | ||
- text: Read Docs | ||
link: /welcome | ||
icon: right-arrow | ||
variant: primary | ||
- text: Read the Starlight docs | ||
link: https://starlight.astro.build | ||
- text: Contribute to Abraxas | ||
link: https://github.com/plutoniumm/abraxas | ||
icon: external | ||
--- | ||
|
||
import { Card, CardGrid } from '@astrojs/starlight/components'; | ||
|
||
## Next steps | ||
|
||
<CardGrid stagger> | ||
<Card title="Update content" icon="pencil"> | ||
Edit `src/content/docs/index.mdx` to see this page change. | ||
</Card> | ||
<Card title="Add new content" icon="add-document"> | ||
Add Markdown or MDX files to `src/content/docs` to create new pages. | ||
</Card> | ||
<Card title="Configure your site" icon="setting"> | ||
Edit your `sidebar` and other config in `astro.config.mjs`. | ||
</Card> | ||
<Card title="Read the docs" icon="open-book"> | ||
Learn more in [the Starlight Docs](https://starlight.astro.build/). | ||
</Card> | ||
</CardGrid> | ||
<div style="display: flex"> | ||
<div style="flex: 1; margin-right: 20px"> | ||
<h3>Interop between Quantum Circuits in different languages</h3> | ||
<p>Abraxas is a peudo <a href="https://en.wikipedia.org/wiki/Intermediate_representation">Intermediate Representation (IR)</a> that allows for the simple interop between quantum circuits in different frameworks with low overhead</p> | ||
</div> | ||
<div style="flex: 1; margin-left: 20px"> | ||
<img src="/favicon.svg" alt="Abraxas Logo" width="150px" height="150px"/> | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
title: toPrime | ||
description: Convert a quantum circuit to prime string | ||
sidebar: | ||
order: 2 | ||
badge: New | ||
--- | ||
|
||
import { Aside } from '@astrojs/starlight/components'; | ||
|
||
## Convert toPrime String | ||
The Prime String is the intermediate representation of the quantum circuit. So before doing anything cross language, you need to convert the circuit to prime string. | ||
|
||
> Make sure to decompose it since only the base gates are supported! | ||
### Qiskit | ||
Let's say we have a standard circuit `EfficientSU2` from Qiskit. We can convert it to prime string using `toPrime` function. | ||
|
||
<Aside type="tip"> | ||
Make sure to run `.decompose` to make sure that the circuit is in basic gates. | ||
|
||
```py | ||
qc = qc.decompose() | ||
``` | ||
</Aside> | ||
|
||
|
||
```python | ||
from qiskit.circuit.library import EfficientSU2 | ||
from abrax import toPrime | ||
|
||
qc = EfficientSU2(3, reps=1).decompose() | ||
string = toPrime(qc) | ||
|
||
# IS THE SAME AS | ||
# -0 ry(θ[0]) rz(θ[3]) cx(1) ry(θ[6]) | ||
# -1 ry(θ[1]) rz(θ[4]) cx(2) ry(θ[7]) | ||
# -2 ry(θ[2]) rz(θ[5]) ry(θ[8]) rz(θ[11]) | ||
``` | ||
|
||
### PennyLane | ||
<Aside type="caution" title="Watch out!"> | ||
Unfortunatelly, PennyLane does not let us inspect a circuit without parameters, therefore pennylane cannot be used fully for variational circuits. Only static circuits can be converted to prime string | ||
</Aside> | ||
|
||
<Aside type="tip"> | ||
Make sure to run `compile()` to make sure that the circuit is in basic gates. | ||
|
||
```py | ||
qfunc = qml.compile(qfunc) | ||
``` | ||
</Aside> | ||
|
||
```python | ||
import pennylane as qml | ||
dev = qml.device('default.qubit', wires=2) | ||
|
||
@qml.qnode(dev) | ||
def circuit(weights, f=None): | ||
qml.QAOAEmbedding(features=f, weights=weights, wires=range(2)) | ||
return qml.expval(qml.PauliZ(0)) | ||
|
||
features = [1., 2.] | ||
layer1 = [0.1, -0.3, 1.5] | ||
layer2 = [3.1, 0.2, -2.8] | ||
weights = [layer1, layer2] | ||
|
||
print(circuit(weights, f=features)) | ||
``` | ||
|
||
### CudaQuantum | ||
<Aside type="danger"> | ||
CudaQuantum is not yet supported | ||
</Aside> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: Common Uses | ||
description: Common uses of abraxas | ||
sidebar: | ||
order: 5 | ||
--- | ||
|
||
Hi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
--- | ||
title: Get Started | ||
description: A starter guide for abraxas | ||
sidebar: | ||
order: 1 | ||
--- | ||
|
||
Abraxas is itself zero-dependency, but you will need to install the dependencies for the specific tasks you want to run. For example, if you want to use the `qiskit` with abraxas you will need qiskit too! | ||
|
||
```sh | ||
pip install abrax | ||
``` | ||
|
||
## Caveats | ||
We usually intend to keep things simple and easy to use, and therefore only simple gates and functions will be supported. If you need to use a more complex gate, you will need to decompose it first OR do the circuit conversion manually |
This file was deleted.
Oops, something went wrong.