Optimize CZGaugeTransformer.as_sweep

Open
#8,346 2 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@pavoljuhas is already working on this.

Since Sep 15, 2026.

Assessment

This issue has not been assessed yet.

Description

area/performance skill/experienced triage/accepted

This transformation is used in the test_dynamical_decoupling_sweep benchmark at line 63 below
https://github.com/quantumlib/Cirq/blob/9a3e166643d9c31cb510083a476b89258e7418cf/benchmarks/dynamical_decoupling_perf.py#L60-L71

According to the cirq_dynamical_decoupling_timing.py.txt timing script it takes about 30% of the benchmark time:

$ python cirq_dynamical_decoupling_timing.py
>>> time_sweep(50, 100)
Generating initial circuit took 0.0010762214660644531 s
Gauge compiling took 20.808635473251343 s    ## THIS STEP ##
Merging gates took 49.60009765625 s
Adding DD took 0.8235270977020264 s

TODO

  • add cz_gauge_perf.py benchmark covering this transformation
  • profile and optimize performance hotspots
Dominant language
Python
Stars
5.1k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
48

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quantumlib/Cirq

All issues in quantumlib/Cirq

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.