Use Custom Gates from Qiskit

Is it possible to use a custom gate with a custom noise model made on qiskit with pennylane? I need a custom noisy gate in my circuit.

Hi @Aswanth_Krishnan! I don’t believe it’s currently possible. However, this would be a great thing for us to add .

Could you post a small code snippet showing an example of what you would like supported?

from qiskit import *
from qiskit.extensions import XGate
from qiskit.providers.aer.noise import NoiseModel, errors
from qiskit.providers.aer.noise.errors import pauli_error

p_bitflip = 0.5 
x_gate = XGate()  # regular X gate

#bit-flip channel
x1_gate = XGate(label="x1")   
x1_error = pauli_error([('X',p_bitflip), ('I', 1 - p_bitflip)])

noise_model = NoiseModel()
noise_model.add_all_qubit_quantum_error(x1_error, x1_gate.label)

I want to use this x1_gate in pennylane.
Thank you for your response.

1 Like

Thanks @Aswanth_Krishnan! I’ll update you on this post when I have more details on implementation.

1 Like