View source on GitHub |
Tools for converting Calibrations to NoiseProperties.
Given a Calibration "cal", a user can simulate noise approximating that calibration using the following pipeline:
<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(cal)</code>
<code class="devsite-terminal" data-terminal-prefix=">>>">noise_model = cirq_google.NoiseModelFromGoogleNoiseProperties(noise_props)</code>
<code class="devsite-terminal" data-terminal-prefix=">>>">simulator = cirq.Simulator(noise=noise_model)</code>
<code class="devsite-terminal" data-terminal-prefix=">>>">circuit = cirq.Circuit(cirq.X(cirq.GridQubit(5, 2)))</code>
<code class="devsite-terminal" data-terminal-prefix=">>>">result = simulator.simulate(circuit)</code>
<code class="no-select nocode"> </code>
</pre>
Functions
noise_properties_from_calibration(...)
: Translates between cirq_google.Calibration
and NoiseProperties.