# Crosstalk Diagnostics¶

Our crosstalk diagnostics tool generates a circuit collection to measure the discrepancy between gate quality while applying gates simultaneously versus while applying gates in an isolated way to each individual system (qubit). This is done by running SRB simultaneously on the specified systems, as well as running it on each system in turn. Optionally, and true by default, this is also done with XRB to learn the discrepancy of the unitarity metric.

One can choose to do any combination of single-qubit twirling or two-qubit twirling on the labels. For instance, setting labels as [[4], [5,6]] indicates single-qubit twirling on qubits 4 and two-qubit twirling on qubits (5,6).

This protocol returns four parameters which characterize the noise acting on a system:

• Unitarity (u)

• Incoherence (inc)

• Average gate infidelity of the error map (r)

• Average gate infidelity of the systematic coherent error (ru)

Note

When crosstalk diagnostics are run without XRB, no information about the incoherence of the system is returned.

## Example¶

#
# Make crosstalk diagnostics example.
# Copyright 2019 Quantum Benchmark Inc.
#

import trueq as tq
import trueq.assessments as tqa

# Generate a circuit collection to run cross-talk diagnostics in single qubit
# mode for qubits 5, 6, 7, and 8.
circuits = tqa.make_crosstalk_diagnostics([5, 6, 7, 8], [4, 100])

# If we think that simultaneous gates will make the gates at most 5 times worse,
circuits = tqa.make_crosstalk_diagnostics([5, 6, 7, 8], [4, 100], simul_ratio=0.2)

# Reduce the number of circuits to perform by excluding XRB circuits.
# This means we cannot learn about incoherence when analyzing data.
circuits = tqa.make_crosstalk_diagnostics([5, 6, 7, 8], [4, 100], include_xrb=False)

# We can also specify that some pairs of qubits undergo two-qubit gates.
circuits = tqa.make_crosstalk_diagnostics([5, [6, 7], 8], [4, 100], include_xrb=False)

# Using the subsets option, we can customize exactly which subsets of the full
# simultaneous twirl are performed in isolation. Here, the default value would
# have resulted in subsets [[5], [6], [7, 8]].
circuits = tqa.make_crosstalk_diagnostics(
[5, 6, [7, 8]], [4, 100], subsets=[[5], [5, 6]]
)

# Initialize a Simulator.