Skip to content

Conversation

GiggleLiu
Copy link
Member

More error types are added and compared with qiskit.

$ python noiseinspect.py

1. Depolarizing Error (p=0.1, num_qubits=1):
SuperOp([[0.95+0.j, 0.  +0.j, 0.  +0.j, 0.05+0.j],
         [0.  +0.j, 0.9 +0.j, 0.  +0.j, 0.  +0.j],
         [0.  +0.j, 0.  +0.j, 0.9 +0.j, 0.  +0.j],
         [0.05+0.j, 0.  +0.j, 0.  +0.j, 0.95+0.j]],
        input_dims=(2,), output_dims=(2,))

2. Thermal Relaxation Error (T1=100, T2=200, time=1):
SuperOp([[1.        +0.j, 0.        +0.j, 0.        +0.j, 0.00995017+0.j],
         [0.        +0.j, 0.99501248+0.j, 0.        +0.j, 0.        +0.j],
         [0.        +0.j, 0.        +0.j, 0.99501248+0.j, 0.        +0.j],
         [0.        +0.j, 0.        +0.j, 0.        +0.j, 0.99004983+0.j]],
        input_dims=(2,), output_dims=(2,))

3. Coherent Unitary Error (X gate):
SuperOp([[0.+0.j, 0.+0.j, 0.+0.j, 1.+0.j],
         [0.+0.j, 0.+0.j, 1.+0.j, 0.+0.j],
         [0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j],
         [1.+0.j, 0.+0.j, 0.+0.j, 0.+0.j]],
        input_dims=(2,), output_dims=(2,))

4. Pauli Error (X with probability 0.1):
SuperOp([[0.9+0.j, 0. +0.j, 0. +0.j, 0.1+0.j],
         [0. +0.j, 0.9+0.j, 0.1+0.j, 0. +0.j],
         [0. +0.j, 0.1+0.j, 0.9+0.j, 0. +0.j],
         [0.1+0.j, 0. +0.j, 0. +0.j, 0.9+0.j]],
        input_dims=(2,), output_dims=(2,))

5. Amplitude Damping Error (param_amp=0.1):
SuperOp([[1.       +0.j, 0.       +0.j, 0.       +0.j, 0.1      +0.j],
         [0.       +0.j, 0.9486833+0.j, 0.       +0.j, 0.       +0.j],
         [0.       +0.j, 0.       +0.j, 0.9486833+0.j, 0.       +0.j],
         [0.       +0.j, 0.       +0.j, 0.       +0.j, 0.9      +0.j]],
        input_dims=(2,), output_dims=(2,))

6. Phase Damping Error (param_phase=0.1):
SuperOp([[1.       +0.j, 0.       +0.j, 0.       +0.j, 0.       +0.j],
         [0.       +0.j, 0.9486833+0.j, 0.       +0.j, 0.       +0.j],
         [0.       +0.j, 0.       +0.j, 0.9486833+0.j, 0.       +0.j],
         [0.       +0.j, 0.       +0.j, 0.       +0.j, 1.       +0.j]],
        input_dims=(2,), output_dims=(2,))

7. Phase-Amplitude Damping Error (param_amp=0.1, param_phase=0.05):
SuperOp([[1.        +0.j, 0.        +0.j, 0.        +0.j, 0.1       +0.j],
         [0.        +0.j, 0.92195445+0.j, 0.        +0.j, 0.        +0.j],
         [0.        +0.j, 0.        +0.j, 0.92195445+0.j, 0.        +0.j],
         [0.        +0.j, 0.        +0.j, 0.        +0.j, 0.9       +0.j]],
        input_dims=(2,), output_dims=(2,))

The Qiskit script is as below:

from qiskit_aer.noise import depolarizing_error, thermal_relaxation_error, ReadoutError, coherent_unitary_error, pauli_error, amplitude_damping_error, phase_damping_error, phase_amplitude_damping_error
from qiskit.quantum_info import SuperOp

# 1. Depolarizing Error
print("1. Depolarizing Error (p=0.1, num_qubits=1):")
error = depolarizing_error(0.1, 1)
print(SuperOp(error))
print()

# 2. Thermal Relaxation Error
print("2. Thermal Relaxation Error (T1=100, T2=200, time=1):")
error = thermal_relaxation_error(100, 200, 1)
print(SuperOp(error))
print()

# 3. Coherent Unitary Error
print("3. Coherent Unitary Error (X gate):")
error = coherent_unitary_error([[0, 1], [1, 0]])
print(SuperOp(error))
print()

# 4. Pauli Error
print("4. Pauli Error (X with probability 0.1):")
error = pauli_error([('X', 0.1), ('I', 0.9)])
print(SuperOp(error))
print()

# 5. Amplitude Damping Error
print("5. Amplitude Damping Error (param_amp=0.1):")
error = amplitude_damping_error(0.1)
print(SuperOp(error))
print()

# 6. Phase Damping Error
print("6. Phase Damping Error (param_phase=0.1):")
error = phase_damping_error(0.1)
print(SuperOp(error))
print()

# 7. Phase-Amplitude Damping Error
print("7. Phase-Amplitude Damping Error (param_amp=0.1, param_phase=0.05):")
error = phase_amplitude_damping_error(0.1, 0.05)
print(SuperOp(error))
print()


# 8. Phase-Amplitude Damping Error with excited state population
print("8. Phase-Amplitude Damping Error with excited state population (param_amp=0.1, param_phase=0.05, excited_state_population=0.1):")
error = phase_amplitude_damping_error(0.1, 0.05, 0.1)
print(SuperOp(error))
print()

@GiggleLiu GiggleLiu requested a review from Roger-luo July 4, 2025 11:53
@GiggleLiu GiggleLiu merged commit 30071f8 into master Jul 10, 2025
24 checks passed
@GiggleLiu GiggleLiu deleted the jg/more-error-types branch July 10, 2025 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants