-
Notifications
You must be signed in to change notification settings - Fork 11
feat: Crosstalk Payload #191
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
base: dev
Are you sure you want to change the base?
Conversation
… noise channel for the it
…omes so that we can apply the transitiosn
…ys from the model
…that accumulates the outcomes of user-issued measurements and returns that only at Complete stage. This allows us to do multiple rounds of communication between the simulator and the noise model via NeedsProcessing.
… and 1->1 so that it matches the behaviour of previous simple crosstalk channel
PabloAndresCQ
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for review. Some comments below to give context to the changes
| measured_qubits: Vec<(usize, GateType)>, | ||
|
|
||
| /// Stored outcome builder | ||
| results_builder: ByteMessageBuilder, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Keeps track of the outcomes that need to be sent back once continue_processing returns Complete(O). This is so that we can have multiple rounds of NeedsProcessing(I) and accummulate the outcomes until we are ready to return them.
| .iter() | ||
| .map(|q| (usize::from(*q), gate.gate_type)), | ||
| ); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved this out because it's necessary to keep track of measured_qubits even if Measure and/or MeasureLeaked are contained in noiseless_gates.
| } | ||
| self.apply_prep_faults(&gate, &mut builder); | ||
| self.apply_crosstalk_faults(&gate, self.p_prep_crosstalk, &mut builder); | ||
| self.apply_simple_crosstalk_faults(&gate, self.p_prep_crosstalk, &mut builder); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Prep still uses the old crosstalk channel. In Selene we currently set p_prep_crosstalk = 0.0.
| // Build and return the biased measurement results | ||
| Ok(results_builder.build()) | ||
| self.results_builder.add_outcomes(&outcomes); | ||
| Ok(ops_builder.build()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
apply_noise_on_continue_processing now always returns a ByteMessage of quantum_ops and appends the outcomes to the new field self.results_builder. It's continue_processing the one that, if this ByteMessage is empty, flushes the results_builder and sends it via Complete(O).
Description
MeasCrosstalkLocalPayloadandMeasCrosstalkGlobalPayloadto communicate details from runtime necessary to model crosstalk more realistically.p_meas_crosstalkhas been replaced byp_meas_crosstalk_globalandp_meas_crosstalk_local. The methodwith_p_meas_crosstalkfrom the builder now sets both of these parameters to the given value. There are also individualwith_*methods for global and local.p_meas_crosstalk_modelfor the transition probabilities after crosstalk-induced Z projection on the victim qubits.Discussion
p_meas_crosstalk_model = {"0->0": 1.0, "1->1: 0.0"}and usingwith_p_meas_crosstalk, the model reproduces the previous implementation of the channel... with one important caveat: PECOS does not itself introduceMeasCrosstalk*Payloadinstructions which are the ones that trigger the crosstalk channels.explicit_meas_crosstalk(that Selene always sets to True) where, if False, causes PECOS to assume it won't receiveMeasCrosstalk*Payloadoperations and instead needs to callapply_crosstalk_faults_from_payload()when encounteringMeasureorMeasureLeaked.