![]() |
Translates between cirq_google.Calibration
and NoiseProperties.
cirq_google.engine.noise_properties_from_calibration(
calibration: engine.Calibration,
*,
gate_times_ns: (dict[type[cirq.Gate], float] | Literal['legacy'] | None) = None,
zphase_data: (util.ZPhaseDataType | None) = None
) -> google_noise_properties.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 = cirq_google.engine.noise_properties_from_calibration(</code>
<code class="devsite-terminal" data-terminal-prefix="..."> cal, gate_times_ns="legacy")</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_37ns = noise_props.with_params(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.
|