Skip to content

Commit 8334af7

Browse files
committed
Merge remote-tracking branch 'origin/main' into 2024-08/sim-report-card
2 parents e18e8ad + 488b9a5 commit 8334af7

File tree

209 files changed

+2028
-1952
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

209 files changed

+2028
-1952
lines changed

dev_tools/requirements/envs/dev.env.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ jupyter-server==2.14.2
288288
# notebook-shim
289289
jupyter-server-terminals==0.5.3
290290
# via jupyter-server
291-
jupyterlab==4.2.4
291+
jupyterlab==4.2.5
292292
# via notebook
293293
jupyterlab-pygments==0.3.0
294294
# via nbconvert

dev_tools/requirements/envs/docs.env.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ jupyter-server-terminals==0.5.3
340340
# via
341341
# -c envs/dev.env.txt
342342
# jupyter-server
343-
jupyterlab==4.2.4
343+
jupyterlab==4.2.5
344344
# via
345345
# -c envs/dev.env.txt
346346
# notebook

dev_tools/requirements/envs/format.env.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ jupyter-server-terminals==0.5.3
310310
# via
311311
# -c envs/dev.env.txt
312312
# jupyter-server
313-
jupyterlab==4.2.4
313+
jupyterlab==4.2.5
314314
# via
315315
# -c envs/dev.env.txt
316316
# notebook

dev_tools/requirements/envs/pylint.env.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ jupyter-server-terminals==0.5.3
360360
# via
361361
# -c envs/dev.env.txt
362362
# jupyter-server
363-
jupyterlab==4.2.4
363+
jupyterlab==4.2.5
364364
# via
365365
# -c envs/dev.env.txt
366366
# notebook

dev_tools/requirements/envs/pytest.env.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ jupyter-server-terminals==0.5.3
334334
# via
335335
# -c envs/dev.env.txt
336336
# jupyter-server
337-
jupyterlab==4.2.4
337+
jupyterlab==4.2.5
338338
# via
339339
# -c envs/dev.env.txt
340340
# notebook

dev_tools/requirements/envs/runtime.env.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ jupyter-server-terminals==0.5.3
293293
# via
294294
# -c envs/dev.env.txt
295295
# jupyter-server
296-
jupyterlab==4.2.4
296+
jupyterlab==4.2.5
297297
# via
298298
# -c envs/dev.env.txt
299299
# notebook

docs/bloq_infra.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ types (``Register``), and algorithms (``CompositeBloq``).
2424
:maxdepth: 1
2525
:caption: Quantum Computer Architectures:
2626

27-
surface_code/azure_cost_model.ipynb
27+
surface_code/physical_cost_model.ipynb
28+
surface_code/beverland_et_al_model.ipynb
2829
surface_code/thc_compilation.ipynb
2930
surface_code/msft_resource_estimator_interop.ipynb
3031

@@ -35,6 +36,7 @@ types (``Register``), and algorithms (``CompositeBloq``).
3536
_infra/composite_bloq.ipynb
3637
cirq_interop/cirq_interop.ipynb
3738
cirq_interop/t_complexity.ipynb
39+
qref_interop/bartiq_demo.ipynb
3840
_infra/gate_with_registers.ipynb
3941
drawing/graphviz.ipynb
4042
drawing/musical_score.ipynb

qualtran/Protocols.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
"\n",
3434
"### Call Graph\n",
3535
"\n",
36-
"You can get a directed-acyclic graph representing the hierarchical decomposition of bloqs by calling `bloq.call_graph()` or direct callees with `bloq.bloq_counts()`. Additional functionality is contained in the `qualtran.resource_counting` module. To implement this protocol, bloq authors can override `Bloq.build_call_graph(...)`. The default fallback uses the decomposition protocol and `build_cbloq_call_graph(...)`. See the full [call graph protocol documentation](./resource_counting/bloq_counts.ipynb) for details.\n",
36+
"You can get a directed-acyclic graph representing the hierarchical decomposition of bloqs by calling `bloq.call_graph()` or direct callees with `bloq.bloq_counts()`. Additional functionality is contained in the `qualtran.resource_counting` module. To implement this protocol, bloq authors can override `Bloq.build_call_graph(...)`. The default fallback uses the decomposition protocol and `build_cbloq_call_graph(...)`. See the full [call graph protocol documentation](./resource_counting/call_graph.ipynb) for details.\n",
3737
"\n",
3838
"### Tensor\n",
3939
"\n",
@@ -65,7 +65,7 @@
6565
"name": "python",
6666
"nbconvert_exporter": "python",
6767
"pygments_lexer": "ipython3",
68-
"version": "3.10.9"
68+
"version": "3.11.8"
6969
}
7070
},
7171
"nbformat": 4,

qualtran/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
QFxp,
5252
QIntOnesComp,
5353
QUInt,
54-
BoundedQUInt,
54+
BQUInt,
5555
QMontgomeryUInt,
5656
)
5757

qualtran/_infra/adjoint.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from collections import Counter
1516
from functools import cached_property
16-
from typing import Dict, List, Optional, Set, Tuple, TYPE_CHECKING
17+
from typing import Dict, List, Optional, Tuple, TYPE_CHECKING
1718

1819
import cirq
1920
from attrs import frozen
@@ -26,7 +27,7 @@
2627
if TYPE_CHECKING:
2728
from qualtran import Bloq, CompositeBloq, Register, Signature, SoquetT
2829
from qualtran.drawing import WireSymbol
29-
from qualtran.resource_counting import BloqCountT, SympySymbolAllocator
30+
from qualtran.resource_counting import BloqCountDictT, SympySymbolAllocator
3031

3132

3233
def _adjoint_final_soqs(cbloq: 'CompositeBloq', new_signature: Signature) -> Dict[str, 'SoquetT']:
@@ -150,17 +151,21 @@ def _circuit_diagram_info_(
150151
sub_info.exponent *= -1
151152
return sub_info
152153

153-
def supports_decompose_bloq(self) -> bool:
154-
"""Delegate to `subbloq.supports_decompose_bloq()`"""
155-
return self.subbloq.supports_decompose_bloq()
156-
157154
def adjoint(self) -> 'Bloq':
158155
"""The 'double adjoint' brings you back to the original bloq."""
159156
return self.subbloq
160157

161-
def build_call_graph(self, ssa: 'SympySymbolAllocator') -> Set['BloqCountT']:
158+
def build_call_graph(self, ssa: 'SympySymbolAllocator') -> 'BloqCountDictT':
162159
"""The call graph takes the adjoint of each of the bloqs in `subbloq`'s call graph."""
163-
return {(bloq.adjoint(), n) for bloq, n in self.subbloq.build_call_graph(ssa=ssa)}
160+
sub_cg = self.subbloq.build_call_graph(ssa=ssa)
161+
counts = Counter['Bloq']()
162+
if isinstance(sub_cg, set):
163+
for bloq, n in sub_cg:
164+
counts[bloq.adjoint()] += n
165+
else:
166+
for bloq, n in sub_cg.items():
167+
counts[bloq.adjoint()] += n
168+
return counts
164169

165170
def pretty_name(self) -> str:
166171
"""The subbloq's pretty_name with a dagger."""

0 commit comments

Comments
 (0)