Initialize Logical Noise
LogicalNoise
Logical noise parameters retrieved from the backend, with utility methods to analyze and visualize the noise. Methods:
Attributes:
get_clifford_logical_error
get_clifford_logical_error(
self: ,
code_distance: int,
error_type: Literal[‘X’, ‘Z’]
) -> float
Evaluate the fitted 1-qubit Clifford logical error rate at a code distance.
The stored fit is p_L(d) = 10 ** (a * cd + b), where (a, b) are the
coefficients returned by the simulation for the requested error type.
Parameters:
Returns:
- Type:
float - The logical error rate
p_L(d).
get_cnot_logical_error
get_cnot_logical_error(
self: ,
code_distance: int,
error_type: Literal[‘IX’, ‘XI’, ‘XX’, ‘IZ’, ‘ZI’, ‘ZZ’]
) -> float
Evaluate the fitted CNOT logical error rate at a code distance.
The stored fit is p_L(d) = 10 ** (a * cd + b), where (a, b) are the
coefficients returned by the simulation for the requested Pauli term.
Parameters:
Returns:
- Type:
float - The logical error rate
p_L(d).
get_s_logical_error
get_s_logical_error(
self: ,
code_distance: int
) -> float
Evaluate the fitted S gate logical error rate at a code distance.
The stored fit is p_L(d) = 10 ** (a * cd + b), where (a, b) are
the coefficients returned by the S gate simulation.
Parameters:
Returns:
- Type:
float - The logical error rate
p_L(d).
plot_clifford
plot_clifford(
self: ,
start: int = 5,
end: int = 31,
show: bool = True
) -> None
Plot the 1-qubit Clifford logical error rates as a function of code distance.
Parameters:
plot_cnot
plot_cnot(
self: ,
start: int = 5,
end: int = 31,
show: bool = True
) -> None
Plot the CNOT logical error rates as a function of code distance.
Parameters:
plot_s
plot_s(
self: ,
start: int = 5,
end: int = 31,
show: bool = True
) -> None
Plot the S gate logical error rate as a function of code distance.
Parameters:
PhysicalNoiseModel
A description of physical noise on a quantum device. Each list field composes the rules it contains: for example, aclifford_1q field with both a DepolarizeRule and a PauliRule(X)
applies both channels after every 1-qubit Clifford operation.
Attributes:
DepolarizeRule
Applies a uniformly random Pauli error with total probabilityp.
p is the probability that some error occurs; with probability 1-p
the identity is applied (no error).
For a 1-qubit operation, each of the 3 Pauli errors (X, Y, Z) has
probability p/3 of being applied.
For a 2-qubit operation, each of the 15 non-identity two-qubit Pauli errors
has probability p/15 of being applied.
Attributes:
PauliRule
Applies a specific Pauli error selected bypauli with probability p.
With probability 1-p the identity is applied (no error).
Attributes:
LogicalNoiseParameters
Representation for logical error rates of different gates. Attributes:Route a Program
TopologicalProgram
A circuit lowered to a 3-D surface-code lattice routing. Attributes:Visualize
Estimate Total Error
Functions
initialize_logical_noise
initialize_logical_noise(
name: str,
noise_model: PhysicalNoiseModel
) -> None
Simulate logical error rates for a physical noise model and store them under name.
Runs the logical noise simulation on the backend and persists the resulting
LogicalNoiseParameters so they can later be retrieved with
get_logical_noise or used by subsequent stages of the engine.
This is a long-running operation (interrupting this SDK function will not interrupt
the initialization in the backend).
Parameters:
get_logical_noise
get_logical_noise(
name: str
) -> LogicalNoise
Retrieve previously initialized logical noise parameters.
Parameters:
Returns:
- Type: LogicalNoise
- The stored parameters wrapped in a
LogicalNoisefor plotting and - analyzing.
remove_logical_noise
remove_logical_noise(
name: str
) -> None
Delete logical noise parameters stored under name.
Parameters:
route_circuit
route_circuit(
qasm: str
) -> TopologicalProgram
Route a transpiled Clifford+T QASM circuit onto a 3-D surface-code lattice.
Parameters:
Returns:
- Type: TopologicalProgram
- A
TopologicalProgramdescribing the routed lattice: per-gate cube - placements, pipes, and aggregate stats.
view_program
view_program(
program: TopologicalProgram,
output_path: str | Path | None = None,
show: bool = False,
start_cycle: int = 0,
end_cycle: int | None = None
) -> str
Render a routed TopologicalProgram as an interactive HTML visualization.
The returned HTML is a self-contained page that can be opened directly in a
web browser.
Parameters:
Returns:
- Type:
str - The HTML document as a string.
estimate_total_errors
estimate_total_errors(
program: TopologicalProgram,
logical_noise: LogicalNoiseParameters | LogicalNoise | str,
code_distances: Iterable[int]
) -> dict[int, float]
Estimate the routed program’s total error (1 - fidelity) at multiple
code distances.
Parameters:
Returns:
- Type:
dict[int, float] - A mapping from each requested code distance to the estimated total error.