Skip to content

Commit 58ca326

Browse files
committed
Merge remote-tracking branch 'origin/main' into 2025-03/strict-interop
2 parents 821dd7d + 94d8026 commit 58ca326

23 files changed

Lines changed: 1207 additions & 177 deletions

CITATION.cff

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ abstract: >-
7272
Qualtran (quantum algorithms translator) is a set of abstractions for
7373
representing quantum programs, and a library of quantum algorithms expressed
7474
in that language to support quantum algorithms research.
75-
version: 0.5.0
76-
date-released: 2024-09-10
75+
version: 0.6.0
76+
date-released: 2025-04-01
7777
url: https://github.com/quantumlib/Qualtran
7878
repository-code: https://github.com/quantumlib/Qualtran
7979
license: Apache-2.0

README.md

Lines changed: 124 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,156 @@
1-
# Qᴜᴀʟᴛʀᴀɴ
1+
<!-- # Qualtran (title omitted because our logo acts as the title) -->
22

3-
Qᴜᴀʟᴛʀᴀɴ (quantum algorithms translator) is a set of abstractions for representing quantum
4-
programs and a library of quantum algorithms expressed in that language to support quantum
5-
algorithms research.
3+
<div align="center">
4+
<img alt="Qualtran logo" width="340px" src="https://raw.githubusercontent.com/quantumlib/Qualtran/refs/heads/main/docs/_static/qualtran-logo-mode-sensitive.svg">
5+
<br>
66

7-
**Note:** Qualtran is an experimental preview release. We provide no backwards compatibility
8-
guarantees. Some algorithms or library functionality may be incomplete or contain inaccuracies.
9-
Open issues or contact the authors with bug reports or feedback.
7+
Python package for fault-tolerant quantum algorithms research.
108

11-
Subscribe to [qualtran-announce@googlegroups.com](https://groups.google.com/g/qualtran-announce)
12-
to receive the latest news and updates!
9+
[![Licensed under the Apache 2.0 open-source license](https://img.shields.io/badge/License-Apache%202.0-3c60b1.svg?logo=opensourceinitiative\&logoColor=white\&style=flat-square)](https://github.com/quantumlib/qualtran/blob/main/LICENSE)
10+
[![Compatible with Python versions 3.10 and higher](https://img.shields.io/badge/Python-3.10+-6828b2.svg?style=flat-square&logo=python&logoColor=white)](https://www.python.org/downloads/)
11+
[![Qualtran project on PyPI](https://img.shields.io/pypi/v/qualtran.svg?logo=python&logoColor=white&label=PyPI&style=flat-square&color=9d3bb8)](https://pypi.org/project/qualtran)
1312

14-
## Documentation
13+
[Installation](#installation) &ndash;
14+
[Usage](#usage) &ndash;
15+
[Documentation](#documentation) &ndash;
16+
[Community](#community) &ndash;
17+
[Citation](#citation) &ndash;
18+
[Contact](#contact)
19+
20+
</div>
1521

16-
Documentation is available at https://qualtran.readthedocs.io/
22+
Qualtran is a set of abstractions for representing quantum programs and a library of quantum
23+
algorithms expressed in that language to support quantum algorithms research.
1724

1825
## Installation
1926

20-
Qualtran is being actively developed. We recommend installing from source:
27+
Qualtran is being actively developed. We recommend installing from the source code.
2128

22-
For a local editable copy:
29+
The following commands will clone a copy of the repository, then install the Qualtran package in
30+
your local Python environment as a local editable copy:
2331

24-
git clone https://github.com/quantumlib/Qualtran.git
25-
cd Qualtran/
26-
pip install -e .
32+
```shell
33+
git clone https://github.com/quantumlib/Qualtran.git
34+
cd Qualtran/
35+
pip install -e .
36+
```
2737

2838
You can also install the latest tagged release using `pip`:
2939

30-
pip install qualtran
40+
```shell
41+
pip install qualtran
42+
```
43+
44+
You can also install the latest version of the main branch on GitHub:
45+
46+
```shell
47+
pip install git+https://github.com/quantumlib/Qualtran
48+
```
49+
50+
## Usage
51+
52+
> [!WARNING]
53+
> Qualtran is an experimental preview release. We provide no backwards compatibility guarantees.
54+
> Some algorithms or library functionality may be incomplete or contain inaccuracies. Open issues or
55+
> contact the authors with bug reports or feedback.
56+
57+
You should be able to import the `qualtran` package into your interactive Python environment as
58+
as well as your programs:
59+
60+
```shell
61+
import qualtran
62+
```
63+
64+
If this is successful, you can move on to learning how to
65+
[write bloqs](https://qualtran.readthedocs.io/en/latest/_infra/Bloqs-Tutorial.html) or investigate
66+
the [bloqs library](https://qualtran.readthedocs.io/en/latest/bloqs/index.html#bloqs-library).
67+
68+
## Documentation
69+
70+
Documentation is available at https://qualtran.readthedocs.io/.
3171

32-
You can also install the latest state of the main branch:
72+
## Community
3373

34-
pip install git+https://github.com/quantumlib/Qualtran
74+
Qualtran's community is growing rapidly, and if you'd like to join the [many open-source
75+
contributors] to the Qualtran project, we welcome your participation! We are dedicated to
76+
cultivating an open and inclusive community, and have a [code of conduct].
3577

36-
## Physical Resource Estimation GUI
78+
[many open-source contributors]: https://github.com/quantumlib/Qualtran/graphs/contributors
79+
[code of conduct]: https://github.com/quantumlib/Qualtran/blob/main/CODE_OF_CONDUCT.md
3780

38-
Qualtran provides a GUI for estimating the physical resources (qubits, magic states, runtime, ..etc) needed to run a quantum algorithm. The GUI can be run locally by running:
81+
### Announcements
3982

40-
cd $QUALTRAN_HOME
41-
python -m qualtran.surface_code.ui
83+
You can stay on top of Qualtran news using the approach that best suits your needs:
4284

43-
## Citation
85+
* For releases and major announcements: join the low-volume mailing list [`qualtran-announce`].
86+
* For releases only:
87+
* *Via GitHub notifications*: configure [repository notifications] for Qualtran.
88+
* *Via RSS from GitHub*: subscribe to the GitHub [Qualtran releases feed].
89+
* *Via RSS from PyPI*: subscribe to the [PyPI releases feed] for Qualtran.
4490

45-
When publishing articles or otherwise writing about Qualtran, please cite the
46-
following:
91+
[`qualtran-announce`]: https://groups.google.com/g/qualtran-announce
92+
[repository notifications]: https://docs.github.com/github/managing-subscriptions-and-notifications-on-github/configuring-notifications
93+
[Qualtran releases feed]: https://github.com/quantumlib/Qualtran/releases.atom
94+
[PyPI releases feed]: https://pypi.org/rss/project/qualtran/releases.xml
4795

48-
```latex
96+
### Questions and Discussions
97+
98+
* If you'd like to ask questions and participate in discussions, join the [`qualtran-dev`]
99+
group/mailing list. By joining [`qualtran-dev`], you will also get automated invites to the
100+
biweekly _Qualtran Sync_ meeting (below).
101+
102+
* Would you like to get more involved in Qualtran development? The biweekly _Qualtran Sync_
103+
is a virtual face-to-face meeting of contributors to discuss everything from issues to
104+
ongoing efforts, as well as to ask questions. Become a member of [`qualtran-dev`] to get
105+
an automatic meeting invitation!
106+
107+
[`qualtran-dev`]: https://groups.google.com/g/qualtran-dev
108+
109+
### Issues and Pull Requests
110+
111+
* Do you have a feature request or want to report a bug? [Open an issue on
112+
GitHub] to report it!
113+
* Do you have a code contribution? Read our [contribution guidelines], then
114+
open a [pull request]!
115+
116+
[Open an issue on GitHub]: https://github.com/quantumlib/Qualtran/issues/new/choose
117+
[contribution guidelines]: https://github.com/quantumlib/Qualtran/blob/main/CONTRIBUTING.md
118+
[pull request]: https://help.github.com/articles/about-pull-requests
119+
120+
## Citation<a name="how-to-cite"></a>
121+
122+
When publishing articles or otherwise writing about Qualtran, please cite the following:
123+
124+
```bibtex
49125
@misc{harrigan2024qualtran,
50126
title={Expressing and Analyzing Quantum Algorithms with Qualtran},
51127
author={Matthew P. Harrigan and Tanuj Khattar
52128
and Charles Yuan and Anurudh Peduri and Noureldin Yosri
53129
and Fionn D. Malone and Ryan Babbush and Nicholas C. Rubin},
54130
year={2024},
55131
eprint={2409.04643},
132+
archivePrefix={arXiv},
133+
primaryClass={quant-ph},
56134
doi={10.48550/arXiv.2409.04643},
57135
url={https://arxiv.org/abs/2409.04643},
58136
}
59137
```
138+
139+
## Contact
140+
141+
For any questions or concerns not addressed here, please email quantum-oss-maintainers@google.com.
142+
143+
## Disclaimer
144+
145+
This is not an officially supported Google product.
146+
This project is not eligible for the [Google Open Source Software Vulnerability Rewards
147+
Program](https://bughunters.google.com/open-source-security).
148+
149+
Copyright 2025 Google LLC.
150+
151+
<div align="center">
152+
<a href="https://quantumai.google">
153+
<img width="15%" alt="Google Quantum AI"
154+
src="https://raw.githubusercontent.com/quantumlib/Qualtran/refs/heads/main/docs/_static/quantum-ai-vertical.svg">
155+
</a>
156+
</div>

dev_tools/bibliography.ipynb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,8 +131,9 @@
131131
"source": [
132132
"for url, clss in sorted(backrefs.items(), key=lambda x: -len(x[1])):\n",
133133
" text = f'### [{titles[url]}]({url})\\n'\n",
134-
" for cls in clss:\n",
135-
" text += f' - {cls.__name__}\\n'\n",
134+
" class_names = [f'{cls._class_name_in_pkg_()}' for cls in clss]\n",
135+
" for cn in sorted(class_names):\n",
136+
" text += f' - {cn}\\n'\n",
136137
"\n",
137138
" display(Markdown(text))"
138139
]

dev_tools/qualtran_dev_tools/notebook_specs.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,8 @@
578578
qualtran.bloqs.gf_arithmetic.gf2_multiplication._MULTIPLY_BY_CONSTANT_MOD_DOC,
579579
qualtran.bloqs.gf_arithmetic.gf2_multiplication._MULTIPLY_POLY_BY_ONE_PLUS_XK_DOC,
580580
qualtran.bloqs.gf_arithmetic.gf2_multiplication._BINARY_POLYNOMIAL_MULTIPLICATION_DOC,
581+
qualtran.bloqs.gf_arithmetic.gf2_multiplication._GF2_SHIFT_RIGHT_MOD_DOC,
582+
qualtran.bloqs.gf_arithmetic.gf2_multiplication._GF2_MUL_DOC,
581583
],
582584
),
583585
NotebookSpecV2(

dev_tools/qualtran_dev_tools/parse_docstrings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ def parse_reference(ref_text: str) -> ReferenceT:
4949
# To match the title and accept as many printable ascii characters as possible
5050
# besides square brackets, I have modified the range approach from
5151
# https://stackoverflow.com/a/31740504.
52-
link_match = re.match(r'^\[([ -Z^-~]+)]\((https?://[\w\d./?=#\-]+)\)\.?\s?(.*)$', ref_text)
52+
link_match = re.match(r'^\[([ -Z^-~]+)]\((https?://[\w\d./?=#\-\(\)]+)\)\.?\s?(.*)$', ref_text)
5353
if link_match:
5454
title = link_match.group(1)
5555
url = link_match.group(2)

dev_tools/qualtran_dev_tools/parse_docstrings_test.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@
1111
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
14-
from .parse_docstrings import get_markdown_docstring_lines
14+
import pytest
15+
16+
from .bloq_finder import get_bloq_classes
17+
from .parse_docstrings import get_markdown_docstring_lines, get_references, UnparsedReference
1518

1619

1720
class ClassWithDocstrings:
@@ -40,3 +43,16 @@ def test_get_markdown_docstring_lines():
4043
' - [Google](www.google.com). Brin et. al. 1999.',
4144
'',
4245
]
46+
47+
48+
@pytest.mark.slow
49+
def test_parse_all_references():
50+
bloq_classes = get_bloq_classes()
51+
references = {bloq_cls: get_references(bloq_cls) for bloq_cls in bloq_classes}
52+
for bloq_cls, refs in references.items():
53+
for ref in refs:
54+
if isinstance(ref, UnparsedReference):
55+
raise AssertionError(
56+
f"{bloq_cls.__module__}.{bloq_cls.__qualname__} has an incorrectly "
57+
f"formatted reference:\n{ref.text}"
58+
)

0 commit comments

Comments
 (0)