Skip to content

Add MultiStepMultiLevelReset gate - #8320

Open
senecameeks wants to merge 1 commit into
mainfrom
u/smeeks/msmlr
Open

Add MultiStepMultiLevelReset gate#8320
senecameeks wants to merge 1 commit into
mainfrom
u/smeeks/msmlr

Conversation

@senecameeks

Copy link
Copy Markdown
Collaborator

This adds the MSMLR gate to cirq_google. It should be similar to #8089 which added the MultilevelResetViaResonator gate to cirq_google.

@github-actions github-actions Bot added the size: L 250< lines changed <1000 label Sep 10, 2026
@senecameeks
senecameeks force-pushed the u/smeeks/msmlr branch 2 times, most recently from 71aed44 to 2954415 Compare September 10, 2026 04:51
@codecov

codecov Bot commented Sep 10, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.59%. Comparing base (43f6849) to head (d1d789c).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #8320      +/-   ##
==========================================
- Coverage   99.59%   99.59%   -0.01%     
==========================================
  Files        1125     1127       +2     
  Lines      103250   103436     +186     
==========================================
+ Hits       102829   103014     +185     
- Misses        421      422       +1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@senecameeks
senecameeks marked this pull request as ready for review September 10, 2026 05:23
# See the License for the specific language governing permissions and
# limitations under the License.

"""Multi-step multi-level reset gate."""

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This comment is not super helpful. Either expand it or remove it, as it is basically a restatement of the file name right now.


import cirq

ValueOrSymbol: TypeAlias = tu.Value | sympy.Basic

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Don't these aliases already exist somewhere?


@attrs.frozen(eq=False, hash=False)
class MultiStepMultiLevelReset(cirq.Gate):
"""Multi-step multi-level reset gate.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this could use some extra information. I think the parameters are pretty difficult to understand without a bit of description as to what this gate is doing.

padding_before: Padding time before the reset trajectory.
padding_after: Padding time after the reset trajectory.
detune_to_start_freq: Whether to detune to start frequency first.
start_at_readout_detuning: Whether to start at readout detuning.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How does this differ from already_at_readout_detuning?


def _serialize_value(value: Any, out_msg: v2.program_pb2.Arg) -> None:
if isinstance(value, dict):
val = "__JSON_DICT__:" + json.dumps(value)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't know about this. Why are we serializing to JSON for dicts? protos have maps.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size: L 250< lines changed <1000

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants