Skip to content

PilotNoiseParams ​

PilotNoiseParams is a pybind11 data class (defined in the C++ extension) that holds noise simulation parameters for the QPilot OS pilot service. It defines the noise model type and associated gate error rates used in noisy quantum circuit simulations.

Note: In pyqpanda3 0.4.0, PilotNoiseParams is an internal C++ type whose constructor is not directly exposed to Python. To create and configure noise parameters, use QCloudNoiseModel from pyqpanda3.qcloud instead -- see the examples below.

Attributes ​

All attributes are publicly accessible read/write fields.

AttributeTypeDescription
noise_modelstrThe noise model identifier (one of the NOISE_MODEL enum names, e.g. "DEPOLARIZING_KRAUS_OPERATOR")
single_gate_paramfloatNoise parameter for single-qubit gates
double_gate_paramfloatNoise parameter for two-qubit gates
single_p2floatSecondary single-qubit noise parameter (used in some noise models)
double_p2floatSecondary two-qubit noise parameter (used in some noise models)
single_pgatefloatSingle-qubit gate error probability
double_pgatefloatTwo-qubit gate error probability

NOISE_MODEL Enum ​

The NOISE_MODEL enum (from pyqpanda3.qcloud) defines the supported noise model types:

Enum ValueNumeric IDDescription
NOISE_MODEL.BITFLIP_KRAUS_OPERATOR0Random X (bit-flip) errors
NOISE_MODEL.BIT_PHASE_FLIP_OPERATOR1Combined bit and phase flip errors
NOISE_MODEL.DAMPING_KRAUS_OPERATOR2Amplitude damping (T1 decay)
NOISE_MODEL.DECOHERENCE_KRAUS_OPERATOR3Combined T1 and T2 decoherence
NOISE_MODEL.DEPHASING_KRAUS_OPERATOR4Phase damping (T2 decay)
NOISE_MODEL.DEPOLARIZING_KRAUS_OPERATOR5Uniform depolarizing noise
NOISE_MODEL.PHASE_DAMPING_OPERATOR6Pure dephasing errors

Examples ​

Create and inspect a noise model using QCloudNoiseModel:

python
from pyqpanda3.qcloud import QCloudNoiseModel, NOISE_MODEL

# Create a depolarizing noise model with 0.1% single-gate
# and 1% two-gate error probabilities
noise_params = QCloudNoiseModel(
    NOISE_MODEL.DEPOLARIZING_KRAUS_OPERATOR,
    [0.001],   # single-qubit gate error probability
    [0.01]     # two-qubit gate error probability
)

# Read noise parameters
print(f"Noise model: {noise_params.get_noise_model()}")
print(f"Single gate params: {noise_params.get_single_params()}")
print(f"Double gate params: {noise_params.get_double_params()}")

Output:

Noise model: DEPOLARIZING_KRAUS_OPERATOR
Single gate params: [0.001]
Double gate params: [0.01]

You can also construct an empty (disabled) noise model and configure it later:

python
from pyqpanda3.qcloud import QCloudNoiseModel, NOISE_MODEL

# Create an empty noise model (disabled by default)
noise_params = QCloudNoiseModel()

# Configure parameters
noise_params.set_single_params([0.001])
noise_params.set_double_params([0.01])

# Check state
print(f"Enabled: {noise_params.is_enabled()}")
print(f"Single gate params: {noise_params.get_single_params()}")
print(f"Double gate params: {noise_params.get_double_params()}")

Output:

Enabled: True
Single gate params: [0.001]
Double gate params: [0.01]

Note: A QCloudNoiseModel constructed with the default constructor initially has is_enabled() == False. It becomes enabled once noise parameters are assigned.

See Also ​

  • QPilotService -- Main service class that uses noise parameters
  • ErrorCode -- Error codes for pilot operations
  • QCloudNoiseModel -- Working noise model class for cloud and simulator configurations

Released under the MIT License.