From 0ef73755838026d29bcd3ee87b0ab75450de72d0 Mon Sep 17 00:00:00 2001
From: plutoniumm <51614345+plutoniumm@users.noreply.github.com>
Date: Thu, 29 Feb 2024 12:18:46 +0530
Subject: [PATCH] init docs
---
.github/workflows/deploy.yml | 31 +++++++++
abrax/compiler.py | 14 ++++
docs/astro.config.mjs | 29 +++++----
docs/src/content/docs/guides/example.md | 11 ----
docs/src/content/docs/index.mdx | 43 +++++--------
docs/src/content/docs/prime.mdx | 74 ++++++++++++++++++++++
docs/src/content/docs/reference/example.md | 11 ----
docs/src/content/docs/uses.md | 8 +++
docs/src/content/docs/welcome.md | 15 +++++
docs/tsconfig.json | 3 -
10 files changed, 173 insertions(+), 66 deletions(-)
create mode 100644 .github/workflows/deploy.yml
delete mode 100644 docs/src/content/docs/guides/example.md
create mode 100644 docs/src/content/docs/prime.mdx
delete mode 100644 docs/src/content/docs/reference/example.md
create mode 100644 docs/src/content/docs/uses.md
create mode 100644 docs/src/content/docs/welcome.md
delete mode 100644 docs/tsconfig.json
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
new file mode 100644
index 0000000..3cdbcac
--- /dev/null
+++ b/.github/workflows/deploy.yml
@@ -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
\ No newline at end of file
diff --git a/abrax/compiler.py b/abrax/compiler.py
index 87ca24a..00bf62c 100644
--- a/abrax/compiler.py
+++ b/abrax/compiler.py
@@ -50,6 +50,20 @@ def compile_pennylane(qfunc) -> str:
tape = qfunc.qtape
num_qubits = len(tape.wires.tolist())
matrix = [[] for _ in range(num_qubits)]
+
+ ops2 = tape.operations
+ # everytime there is a Tofolli, remove it and add 2 CNOTs a,b | b,c
+ for i in range(len(ops2)):
+ if ops2[i].name == 'Toffoli':
+ a, b, c = ops2[i].wires.tolist()
+ tape.operations[i] = tape.operations[i]._replace(
+ name='CNOT', wires=[a, b]
+ )
+ tape.operations.insert(
+ i + 1, tape.operations[i]._replace(name='CNOT', wires=[b, c])
+ )
+
+
for i in tape.operations:
gate = i.name
qubits = i.wires.tolist()
diff --git a/docs/astro.config.mjs b/docs/astro.config.mjs
index cf7d71b..b4bffb3 100644
--- a/docs/astro.config.mjs
+++ b/docs/astro.config.mjs
@@ -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,
} ),
],
} );
diff --git a/docs/src/content/docs/guides/example.md b/docs/src/content/docs/guides/example.md
deleted file mode 100644
index ebd0f3b..0000000
--- a/docs/src/content/docs/guides/example.md
+++ /dev/null
@@ -1,11 +0,0 @@
----
-title: Example Guide
-description: A guide in my new Starlight docs site.
----
-
-Guides lead a user through a specific task they want to accomplish, often with a sequence of steps.
-Writing a good guide requires thinking about what your users are trying to do.
-
-## Further reading
-
-- Read [about how-to guides](https://diataxis.fr/how-to-guides/) in the Diátaxis framework
diff --git a/docs/src/content/docs/index.mdx b/docs/src/content/docs/index.mdx
index 117179d..27d44fa 100644
--- a/docs/src/content/docs/index.mdx
+++ b/docs/src/content/docs/index.mdx
@@ -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
-
-
Abraxas is a peudo Intermediate Representation (IR) that allows for the simple interop between quantum circuits in different frameworks with low overhead
+