Skip to content

Move moment index into circuit message #7008

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

Merged
merged 8 commits into from
Feb 4, 2025
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 11 additions & 7 deletions cirq-google/cirq_google/api/v2/program.proto
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,20 @@ message Circuit {
// The moments of the circuit, with the first element corresponding to the
// first set of operations to apply, etc.
repeated Moment moments = 2;


// The index of the moment in the top-level constant table.
// In order to preserve ordering, either this field should be populated
// or the moments field, but not both.
// This field is used to reduce size of circuits that contain many
// repeated moments.
repeated int32 moment_indices = 3;
}

// A moment is a collection of operations and circuit operations that operate
// on a disjoint set of qubits. Conceptually, a moment represents operations
// that all occur in the same finite period of time.
message Moment {
// The index of the moment in the top-level constant table.
// If this field is populated, the other fields should be ignored
// in favor using the constant table lookup.
// This field is used to reduce size of circuits that contain many
// repeated moments.
optional int32 moment_constant_index = 3;

// All of the gate operations in the moment. Each operation and circuit
// operation must act on different qubits.
repeated Operation operations = 1;
Expand All @@ -97,6 +98,9 @@ message Moment {
// table should be preferred for circuits with repeated operations
// for improved serialization size.
repeated int32 operation_indices = 4;

// Deprecated field id, do not use.
reserved 3;
}

// The quantum circuit, specified as a series of operations at specific
Expand Down
Loading