View source on GitHub |
Translates between cirq_google.Calibration
and NoiseProperties.
cirq_google.engine.noise_properties_from_calibration(
calibration: cirq_google.engine.Calibration
,
zphase_data: Optional[cirq_google.engine.util.ZPhaseDataType
] = None,
gate_times_ns: Optional[Dict[Type['cirq.Gate'], float]] = None
) -> cirq_google.devices.GoogleNoiseProperties
The NoiseProperties object can then be used as input to the
cirq_google.NoiseModelFromGoogleNoiseProperties
class to create a
cirq.NoiseModel
that can be used with a simulator.
To manually override noise properties, call with_params
on the output:
<pre class="devsite-click-to-copy prettyprint lang-py">
<code class="devsite-terminal" data-terminal-prefix=">>>">cal = cirq_google.engine.load_median_device_calibration("rainbow")</code>
<code class="devsite-terminal" data-terminal-prefix=">>>"># noise_props with all gate durations set to 37ns.</code>
<code class="devsite-terminal" data-terminal-prefix=">>>">noise_props = cirq_google.engine.noise_properties_from_calibration(cal).with_params(</code>
<code class="devsite-terminal" data-terminal-prefix="..."> gate_times_ns=37)</code>
<code class="no-select nocode"> </code>
</pre>
See cirq_google.GoogleNoiseProperties
for details.
Returns | |
---|---|
A cirq_google.GoogleNoiseProperties which represents the error
present in the given Calibration object.
|