Skip to content

Commit

Permalink
Merge master branch into dev (#1199)
Browse files Browse the repository at this point in the history
Co-authored-by: Mudit Pandey <[email protected]>
  • Loading branch information
josh146 and mudit2812 authored Aug 28, 2024
1 parent 7cdaa71 commit 1714f2a
Show file tree
Hide file tree
Showing 807 changed files with 1,975 additions and 917 deletions.
185 changes: 137 additions & 48 deletions .github/workflows/gatsby-node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,37 +7,19 @@

/* eslint-disable @typescript-eslint/no-var-requires */
const { createFilePath } = require(`gatsby-source-filesystem`)
import { CreateBabelConfigArgs, GatsbyNode } from 'gatsby'
import {
CreateBabelConfigArgs,
CreateNodeArgs,
GatsbyNode,
} from 'gatsby'
import path from 'path'

interface IOnCreateNodeProps {
node: { internal: { type: string } }
actions: {
createNodeField: (field: {
name: string
node: { internal: { type: string } }
value: string
}) => void
}
getNode: () => void
}

interface IOnCreateNodeProps {
node: { internal: { type: string } }
actions: {
createNodeField: (field: {
name: string
node: { internal: { type: string } }
value: string
}) => void
}
getNode: () => void
}

/**
* onCreateNode - Called when a new node is created. Plugins wishing to extend or transform nodes created by other plugins should implement this API.
* https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/#onCreateNode
* @type {import('gatsby').GatsbyNode['onCreateNode']}
*/
exports.onCreateNode = ({ node, actions, getNode }: IOnCreateNodeProps) => {
exports.onCreateNode = ({ node, actions, getNode }: CreateNodeArgs) => {
const { createNodeField } = actions

if (node.internal.type === `MarkdownRemark`) {
Expand All @@ -51,6 +33,10 @@ exports.onCreateNode = ({ node, actions, getNode }: IOnCreateNodeProps) => {
}
}

/**
* onCreateBabelConfig - Let plugins extend/mutate the site’s Babel configuration by calling setBabelPlugin or setBabelPreset.
* https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/#onCreateBabelConfig
*/
exports.onCreateBabelConfig = ({ actions }: CreateBabelConfigArgs) => {
actions.setBabelPlugin({
name: '@babel/plugin-transform-react-jsx',
Expand All @@ -61,6 +47,8 @@ exports.onCreateBabelConfig = ({ actions }: CreateBabelConfigArgs) => {
}

/**
* createSchemaCustomization - Customize Gatsby’s GraphQL schema by creating type definitions, field extensions or adding third-party schemas.
* https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/#createSchemaCustomization
* @type {import('gatsby').GatsbyNode['createSchemaCustomization']}
*/
exports.createSchemaCustomization = ({
Expand Down Expand Up @@ -131,31 +119,33 @@ exports.createSchemaCustomization = ({
`)
}

/**
* Import UI templates
* Templates are used in createPages to programmatically create page.
*/

const demoPage = path.resolve(
`${__dirname}/src/templates/demos/individualDemo/demo.tsx`
)

/**
* createPages - Create pages dynamically.
* This extension point is called only after the initial sourcing and transformation of nodes
* plus creation of the GraphQL schema are complete so you can query your data in order to create pages.
* https://www.gatsbyjs.com/docs/reference/config-files/gatsby-node/#onCreateWebpackConfig
*/
export const createPages: GatsbyNode['createPages'] = async ({
graphql,
actions,
reporter,
}) => {
const { createPage, createRedirect } = actions

type allMarkdownRemarkTypeData = {
allMarkdownRemark: {
nodes: {
frontmatter: {
slug: string
title: string
meta_description: string
}
id: string
}[]
}
}
const { createPage } = actions

// Queries
// -------

const DemosResults = await graphql<allMarkdownRemarkTypeData>(`
// Query .md files from /content/demos directory
const DemosResults = await graphql<Queries.GetDemoDataQuery>(`
query GetDemoData {
allMarkdownRemark(filter: { fileAbsolutePath: { regex: "/demos/" } }) {
nodes {
Expand All @@ -170,19 +160,118 @@ export const createPages: GatsbyNode['createPages'] = async ({
}
`)

if (DemosResults.errors) {
reporter.panicOnBuild(
'🚨 ERROR: Loading "createPages" query for demo pages'
)
}

// Query demo authors & slugs from search query in PennyLane Cloud
const DemoAuthorResult = await graphql<Queries.GetDemoAuthorDataQuery>(`
query GetDemoAuthorData {
pennylaneCloud {
search(input: { contentTypes: DEMO }) {
items {
... on pennylaneCloud_GenericContent {
authors {
... on pennylaneCloud_AuthorName {
name
}
... on pennylaneCloud_Profile {
handle
firstName
headline
lastName
avatarUrl
}
}
slug
}
}
}
}
}
`)

if (DemoAuthorResult.errors) {
reporter.panicOnBuild(
`There was an error loading your demo authors`,
DemoAuthorResult.errors
)
return
}

// Query blog authors & slugs from search query in PennyLane Cloud
const BlogAuthorResult = await graphql<Queries.GetBlogAuthorDataQuery>(`
query GetBlogAuthorData {
pennylaneCloud {
search(input: { contentTypes: BLOG }) {
items {
... on pennylaneCloud_GenericContent {
authors {
... on pennylaneCloud_AuthorName {
name
}
... on pennylaneCloud_Profile {
handle
firstName
headline
lastName
avatarUrl
}
}
slug
}
}
}
}
}
`)

if (BlogAuthorResult.errors) {
reporter.panicOnBuild(
`There was an error loading your blog authors`,
BlogAuthorResult.errors
)
return
}

/**
* Create a map for content slug and authors
* to easily fetch authors for demo & blog pages while creating them programmatically.
*/
const contentAuthorMap = {}
const demoSearchItems =
DemoAuthorResult.data?.pennylaneCloud.search.items || []
const blogSearchItems =
BlogAuthorResult.data?.pennylaneCloud.search.items || []

demoSearchItems.forEach((content) => {
contentAuthorMap[content['slug']] = content['authors']
})
blogSearchItems.forEach((content) => {
contentAuthorMap[`/${content['slug']}/`] = content['authors']
})

// Create Pages Programmatically
// -----------------------------
// Create Demo Pages
const demos = DemosResults.data
? DemosResults.data.allMarkdownRemark.nodes
: []

if (demos && demos.length) {
demos.forEach((demo) => {
createPage({
path: `/qml/demos/${demo.frontmatter.slug}`,
component: demoPage,
context: {
id: demo.id,
},
})
if (demo.frontmatter?.slug) {
createPage({
path: `/qml/demos/${demo.frontmatter.slug}`,
component: demoPage,
context: {
id: demo.id,
authors: contentAuthorMap[demo.frontmatter.slug],
},
})
}
})
}
}
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ environment:
$$PYTHON_VENV_PATH/bin/python -m pip install --upgrade git+https://github.com/PennyLaneAI/pennylane-cirq.git#egg=pennylane-cirq;\
$$PYTHON_VENV_PATH/bin/python -m pip install --upgrade git+https://github.com/PennyLaneAI/pennylane-qiskit.git#egg=pennylane-qiskit;\
$$PYTHON_VENV_PATH/bin/python -m pip install --upgrade git+https://github.com/PennyLaneAI/pennylane-qulacs.git#egg=pennylane-qulacs;\
$$PYTHON_VENV_PATH/bin/python -m pip install -i https://test.pypi.org/simple/ PennyLane-Lightning --pre --upgrade;\
$$PYTHON_VENV_PATH/bin/python -m pip install -i https://test.pypi.org/simple/ PennyLane-Catalyst --pre --upgrade;\
$$PYTHON_VENV_PATH/bin/python -m pip install --extra-index-url https://test.pypi.org/simple/ PennyLane-Lightning --pre --upgrade;\
$$PYTHON_VENV_PATH/bin/python -m pip install --extra-index-url https://test.pypi.org/simple/ PennyLane-Catalyst --pre --upgrade;\
fi;\
fi
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ quantum computing paper/result.
- Make sure the file name is `<name of your tutorial>.metadata.json`.
- The "id" of the author will be the same as the one you chose when creating the bio.
- The date of publication and modification. Leave them empty in case you don't know them.
- Choose the categories your demo fits into: `"Getting Started"`, `"Optimization"`, `"Quantum Machine Learning"`, `"Quantum Chemistry"`, `"Devices and Performance"`, `"Quantum Computing"`, `"Quantum Hardware"` or `"Algorithms"`. Feel free to add more than one.
- Choose the categories your demo fits into: `"Getting Started"`, `"Optimization"`, `"Quantum Machine Learning"`, `"Quantum Chemistry"`, `"Devices and Performance"`, `"Quantum Computing"`, `"Quantum Hardware"`, `"Algorithms"` or `"How-to"`. Feel free to add more than one.
- In `previewImages` you should simply modify the final part of the file's name to fit the name of your demo. These two images will be sent to you once the review process begins. Once sent, you must upload them to the address indicated in the metadata.
- `relatedContent` refers to the demos related to yours. You will have to put the corresponding id and set the `weight` to `1.0`.
- If there is any doubt with any field, do not hesitate to post a comment to the reviewer of your demo.
Expand Down
Binary file modified _static/authors/alain_delgado.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/alejandro_montanez.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/ali_asadi.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/andrea_mari.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/andrea_mari_original.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/angus_lowe.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/angus_lowe_original.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/antal_szava.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/antal_szava_original.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/anuj_apte.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/anuj_apte_original.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/ara_ghukasyan.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/aroosa_ijaz.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/aroosa_ijaz_original.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/borja_requena.jpg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/brian_doolittle.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/brian_doolittle_original.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/chase_roberts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/christina_lee.JPG
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/clara_ferreira_cores.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/dan_strano.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/danial_motlagh.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/david_ittah.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/david_wakeham_original.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/david_wierichs.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified _static/authors/diksha_dhawan.png
Binary file modified _static/authors/gideon_uchehara.jpg
Binary file modified _static/authors/guillermo_alonso.jpeg
Binary file modified _static/authors/isaac_de_vlugt.jpeg
Binary file modified _static/authors/isabel_nha_minh_le.jpg
Binary file modified _static/authors/isidor_schoch.png
Binary file modified _static/authors/jack_stephen_baker.png
Binary file modified _static/authors/james_ellis.jpg
Binary file modified _static/authors/jarrett_smalley.png
Binary file modified _static/authors/joana_fraxanet.jpeg
Binary file modified _static/authors/johannes_jakob_meyer.png
Binary file modified _static/authors/josh_izaac_original.png
Binary file modified _static/authors/juan_felipe_carrasquilla_alvarez.png
Binary file modified _static/authors/lillian_frederiksen.png
Binary file modified _static/authors/luis_mantilla.jpg
Binary file modified _static/authors/maggie_li.jpg
Binary file modified _static/authors/maggie_li_original.jpg
Binary file modified _static/authors/mark_nicholas_jones.png
Binary file modified _static/authors/matthew_silverman.jpg
Binary file modified _static/authors/nathan_killoran.jpg
Binary file modified _static/authors/nathan_killoran_original.jpg
Binary file modified _static/authors/paul_k_faehrmann.jpg
Binary file modified _static/authors/peter-jan_derks.png
Binary file modified _static/authors/peter-jan_derks_original.png
Binary file modified _static/authors/radoica_draskic.jpg
Binary file modified _static/authors/reast.jpeg
Binary file modified _static/authors/richard_east.jpeg
Binary file modified _static/authors/romain_moyard.jpg
Binary file modified _static/authors/santosh_kumar_radha.png
Binary file modified _static/authors/shahnawaz_ahmed.png
Binary file modified _static/authors/shahnawaz_ahmed_original.png
Binary file modified _static/authors/shaoming_zhang.png
Binary file modified _static/authors/soran_jahangiri.png
Binary file modified _static/authors/stefano_mangini.jpg
Binary file modified _static/authors/stefano_mangini_original.jpg
Binary file modified _static/authors/stepan_fomichev.jpg
Binary file modified _static/authors/sukin_sim.png
Binary file modified _static/authors/sukin_sim_original.png
Binary file modified _static/authors/theodor_isacsson.jpg
Binary file modified _static/authors/thomas_bromley.png
Binary file modified _static/authors/thomas_bromley_original.png
Binary file modified _static/authors/utkarsh_azad.png
Binary file modified _static/authors/varun_rishi_original.png
File renamed without changes
Binary file modified _static/demonstration_assets/QUBO/items_QUBO.png
Binary file modified _static/demonstration_assets/adaptive_circuits/h_sparse.png
Binary file modified _static/demonstration_assets/adaptive_circuits/main.png
Binary file modified _static/demonstration_assets/ahs_aquila/aquila_demo_image.png
Binary file modified _static/demonstration_assets/ahs_aquila/gaussian_fn.png
Binary file modified _static/demonstration_assets/ahs_aquila/rydberg_blockade.png
Binary file modified _static/demonstration_assets/barren_plateaus/surface.png
Binary file modified _static/demonstration_assets/classical_kernels/salesman.PNG
Binary file modified _static/demonstration_assets/classically_boosted_vqe/CB_VQE.png
Binary file modified _static/demonstration_assets/contextuality/model.png
Binary file modified _static/demonstration_assets/contextuality/rps.png
Binary file modified _static/demonstration_assets/contextuality/rpstable.png
Binary file modified _static/demonstration_assets/eqnn_force_field/overview.png
Binary file modified _static/demonstration_assets/error_mitigation/laptop.png
Loading

0 comments on commit 1714f2a

Please sign in to comment.