Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Derive slug field for demos in metadata.json #1228

Merged
merged 6 commits into from
Oct 4, 2024

Conversation

Mandrenkov
Copy link
Collaborator

@Mandrenkov Mandrenkov commented Oct 3, 2024

Summary:
This PR adds a slug field to each item in metadata.json. The slug is derived from the filename of the demo and will eventually replace the canonicalURL field. In a subsequent PR, the canonical URL field will be removed.

Relevant references:
None.

Possible Drawbacks:
None.

Related GitHub Issues:
None.

Other Notes:

  • This PR includes a new GHA workflow "Build Website - Text (Test)" for testing purposes. The workflow should be deleted prior to merging this PR.

Verification:
The generated metadata.json file has the correct slug field for each demo in the Glass Onion bucket.

metadata.json Snippet

[
  {
    "authors": [
      {
        "username": "whatsis"
      }
    ],
    "basedOnPapers": [],
    "canonicalURL": "/qml/demos/tutorial_how_to_use_noise_models",
    "categories": [
      "Quantum Computing",
      "How-to"
    ],
    "dateOfLastModification": "2024-10-01T00:00:00+00:00",
    "dateOfPublication": "2024-10-01T00:00:00+00:00",
    "doi": "",
    "previewImages": [
      {
        "type": "thumbnail",
        "uri": "/_static/demo_thumbnails/regular_demo_thumbnails/thumbnail_how_to_use_noise_models.png"
      },
      {
        "type": "large_thumbnail",
        "uri": "/_static/demo_thumbnails/large_demo_thumbnails/thumbnail_large_how_to_use_noise_models.png"
      }
    ],
    "referencedByPapers": [],
    "references": [],
    "relatedContent": [
      {
        "id": "tutorial_noisy_circuits",
        "type": "demonstration",
        "weight": 1
      }
    ],
    "seoDescription": "Learn how noise models can be built and inserted into a quantum circuit in PennyLane.",
    "slug": "tutorial_how_to_use_noise_models",
    "tags": [],
    "title": "How to use noise models in PennyLane"
  },
  {
    "authors": [
      {
        "username": "alvaro"
      }
    ],
    "basedOnPapers": [],
    "canonicalURL": "/qml/demos/tutorial_photonics",
    "categories": [
      "Quantum Hardware",
      "Quantum Computing"
    ],
    "dateOfLastModification": "2024-08-06T00:00:00+00:00",
    "dateOfPublication": "2022-05-31T00:00:00+00:00",
    "doi": "",
    "previewImages": [
      {
        "type": "thumbnail",
        "uri": "/_static/demo_thumbnails/regular_demo_thumbnails/thumbnail_photonic_QC.png"
      }
    ],
    "referencedByPapers": [],
    "references": [
      {
        "authors": "D. DiVincenzo",
        "id": "DiVincenzo2000",
        "journal": "Fortschritte der Physik",
        "title": "The Physical Implementation of Quantum Computation",
        "type": "article",
        "url": "https://onlinelibrary.wiley.com/doi/10.1002/1521-3978(200009)48:9/11%3C771::AID-PROP771%3E3.0.CO;2-E",
        "year": "2000"
      },
      {
        "authors": "C. Weedbrook, et al.",
        "id": "Weedbrook2012",
        "journal": "Rev. Mod. Phys.",
        "title": "Gaussian Quantum Information",
        "type": "article",
        "url": "https://journals.aps.org/rmp/abstract/10.1103/RevModPhys.84.621",
        "year": "2012"
      },
      {
        "authors": "S. Sabouri, et al.",
        "id": "Sabouri2021",
        "journal": "IEEE Photonics Journal",
        "number": "2",
        "title": "Thermo Optical Phase Shifter With Low Thermal Crosstalk for SOI Strip Waveguide",
        "type": "article",
        "url": "https://ieeexplore.ieee.org/document/9345963",
        "volume": "13",
        "year": "2021"
      },
      {
        "authors": "M. Paris",
        "id": "Paris1996",
        "journal": "Physics Letters A",
        "title": "Displacement operator by beam splitter",
        "type": "article",
        "url": "https://www.sciencedirect.com/science/article/abs/pii/0375960196003398?via%3Dihub",
        "year": "1996"
      },
      {
        "authors": "S. Braunstein, P. van Loock",
        "id": "Braunstein2005",
        "journal": "Rev. Mod. Phys.",
        "title": "Quantum information with continuous variables",
        "type": "article",
        "url": "https://journals.aps.org/rmp/abstract/10.1103/RevModPhys.77.513",
        "year": "2005"
      },
      {
        "authors": "C. Hamilton, et al.",
        "id": "Hamilton2017",
        "journal": "Phys. Rev. Lett.",
        "title": "Gaussian Boson Sampling",
        "type": "article",
        "url": "https://journals.aps.org/prl/abstract/10.1103/PhysRevLett.119.170501",
        "year": "2017"
      },
      {
        "authors": "H.S. Zhong, et al.",
        "id": "Zhong2020",
        "journal": "Science",
        "title": "Quantum computational advantage using photons",
        "type": "article",
        "url": "https://www.science.org/doi/10.1126/science.abe8770",
        "year": "2020"
      },
      {
        "authors": "L. Madsen, et al.",
        "id": "Madsen2020",
        "journal": "Nature",
        "title": "Quantum computational advantage with a programmable photonic processor",
        "type": "article",
        "url": "https://www.nature.com/articles/s41586-022-04725-x",
        "year": "2022"
      },
      {
        "authors": "I. Tzitrin, et al.",
        "id": "Tzitrin2020",
        "journal": "Phys. Rev. A",
        "title": "Progress towards practical qubit computation using approximate Gottesman-Kitaev-Preskill codes",
        "type": "article",
        "url": "https://journals.aps.org/pra/abstract/10.1103/PhysRevA.64.012310",
        "year": "2020"
      },
      {
        "authors": "E. Bourassa, et al.",
        "id": "Bourassa2021",
        "journal": "Quantum",
        "title": "Blueprint for a Scalable Photonic Fault-Tolerant Quantum Computer",
        "type": "article",
        "url": "https://quantum-journal.org/papers/q-2021-02-04-392/",
        "year": "2021"
      }
    ],
    "relatedContent": [
      {
        "id": "tutorial_pasqal",
        "type": "demonstration",
        "weight": 1
      },
      {
        "id": "tutorial_trapped_ions",
        "type": "demonstration",
        "weight": 1
      },
      {
        "id": "tutorial_sc_qubits",
        "type": "demonstration",
        "weight": 1
      },
      {
        "id": "gbs",
        "type": "demonstration",
        "weight": 1
      }
    ],
    "seoDescription": "Learn how photonic quantum computers work through code",
    "slug": "tutorial_photonics",
    "tags": [],
    "title": "Photonic quantum computers"
  },
  {
    "authors": [
      {
        "id": "diksha_dhawan"
      }
    ],
    "basedOnPapers": [],
    "canonicalURL": "/qml/demos/tutorial_mapping",
    "categories": [
      "Algorithms",
      "Quantum Computing",
      "Quantum Chemistry"
    ],
    "dateOfLastModification": "2024-08-05T00:00:00+00:00",
    "dateOfPublication": "2024-05-06T00:00:00+00:00",
    "doi": "",
    "previewImages": [
      {
        "type": "thumbnail",
        "uri": "/_static/demonstration_assets/mapping/thumbnail_mapping_2024-06-20.png"
      },
      {
        "type": "large_thumbnail",
        "uri": "/_static/demo_thumbnails/large_demo_thumbnails/thumbnail_large_mapping_2024-06-20.png"
      }
    ],
    "referencedByPapers": [],
    "references": [
      {
        "authors": "A. Tranter, S. Sofia et al.",
        "id": "Tranter",
        "publisher": "International Journal of Quantum Chemistry",
        "title": "The Bravyi–Kitaev Transformation: Properties and Applications",
        "type": "article",
        "url": "https://onlinelibrary.wiley.com/doi/10.1002/qua.24969",
        "year": "2015"
      },
      {
        "authors": "Y. S. Yordanov et al.",
        "id": "Yordanov",
        "publisher": "Physical Review A",
        "title": "Efficient quantum circuits for quantum computational chemistry",
        "type": "article",
        "url": "https://journals.aps.org/pra/abstract/10.1103/PhysRevA.102.062612",
        "year": "2020"
      }
    ],
    "relatedContent": [],
    "seoDescription": "Learn how to map fermionic operators to qubit operators",
    "slug": "tutorial_mapping",
    "tags": [],
    "title": "Mapping fermionic Hamiltonians to qubit Hamiltonians"
  },
  # ...
]

@Mandrenkov Mandrenkov added the ci:build-all-qml-demos Build all the Demos for this Pull Request label Oct 3, 2024
Copy link

github-actions bot commented Oct 3, 2024

Thank you for opening this pull request.

You can find the built site at this link.

Deployment Info:

  • Pull Request ID: 1228
  • Deployment SHA: 8cd1592824d0d41653457e64dc41c94c6c8b8413
    (The Deployment SHA refers to the latest commit hash the docs were built from)

Note: It may take several minutes for updates to this pull request to be reflected on the deployed site.

Copy link

@anthayes92 anthayes92 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, appreciate the test! 🧪

@Mandrenkov Mandrenkov merged commit d73cdab into master Oct 4, 2024
6 checks passed
@Mandrenkov Mandrenkov deleted the sc-72674-add-slug-field-to-metadata branch October 4, 2024 19:00
Mandrenkov added a commit that referenced this pull request Oct 8, 2024
**Title:**
Remove the `canonicalURL` field from demo metadata.

**Summary:**
This PR removes the `canonicalURL` field from existing demo metadata.
The `canonicalURL` field has been superseded by the (autogenerated)
`slug` field as of #1228.

**Relevant references:**
None.

**Possible Drawbacks:**
None.

**Related GitHub Issues:**
None.

---

**Detailed Changes:**
1. Fixed the `$id` reference in `demo.metadata.schema.0.1.3.json`. 
2. Added `demo.metadata.schema.0.1.4.json` which removes the
`canonicalURL` field.
3. Updated the example metadata in `demonstrations_metadata.md`.
4. Removed the `canonicalURL` field from existing demo metadata (and
adjusted `dateOfLastModification`).
5. Deleted the obsolete `update_metadata.py` script.

**Merge Checklist:**
* [x] Delete the "Build Website - Text (Test)" GHA workflow which was
added for testing purposes.

**Verification:**

The generated `metadata.json` file in the Glass Onion bucket no longer
has any `canonicalURL` fields:

<details><summary><tt>metadata.json</tt> Snippet</summary>
<p>

```json
[
  {
    "authors": [
      {
        "username": "whatsis"
      }
    ],
    "basedOnPapers": [],
    "categories": [
      "Quantum Computing",
      "How-to"
    ],
    "dateOfLastModification": "2024-10-07T00:00:00+00:00",
    "dateOfPublication": "2024-10-01T00:00:00+00:00",
    "doi": "",
    "previewImages": [
      {
        "type": "thumbnail",
        "uri": "/_static/demo_thumbnails/regular_demo_thumbnails/thumbnail_how_to_use_noise_models.png"
      },
      {
        "type": "large_thumbnail",
        "uri": "/_static/demo_thumbnails/large_demo_thumbnails/thumbnail_large_how_to_use_noise_models.png"
      }
    ],
    "referencedByPapers": [],
    "references": [],
    "relatedContent": [
      {
        "id": "tutorial_noisy_circuits",
        "type": "demonstration",
        "weight": 1
      }
    ],
    "seoDescription": "Learn how noise models can be built and inserted into a quantum circuit in PennyLane.",
    "slug": "tutorial_how_to_use_noise_models",
    "tags": [],
    "title": "How to use noise models in PennyLane"
  },
  ...
]
```

</p>
</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants