Hi, how do I put error mitigation schemes into my Pennylane code?
So my code is:
# QML
import pennylane as qml
wires=4
dev4 = qml.device('qiskit.ibmq', wires=wires, backend='ibm_nairobi',
ibmqx_token='XXX', hub='ibm-q', group='open',
project='main', shots=100)
coupling_map = dev4.backend.configuration().to_dict()["coupling_map"]
dev4.set_transpile_args(
**{
"optimization_level": 1,
"coupling_map": coupling_map,
"layout_method": "sabre",
"routing_method": "sabre",
}
)
@qml.qnode(dev4)
def CONVCircuit(phi, wires, i=0):
"""
quantum convolution Node
"""
# parameter
theta = np.pi / 2
qml.RX(phi[0] * np.pi, wires=0)
qml.RX(phi[1] * np.pi, wires=1)
qml.RX(phi[2] * np.pi, wires=2)
qml.RX(phi[3] * np.pi, wires=3)
qml.CRZ(theta, wires=[1, 0])
qml.CRZ(theta, wires=[3, 2])
qml.CRX(theta, wires=[1, 0])
qml.CRX(theta, wires=[3, 2])
qml.CRZ(theta, wires=[2, 0])
qml.CRX(theta, wires=[2, 0])
# Expectation value
measurement = qml.expval(qml.PauliZ(wires=0))
return measurement
In the above code, where should I put the error mitigation techniques like M3 error mitigation , Digital ZNE and others?
In Qiskit, we use:
options = Options(resilience_level = 1)
with Session(service=service, backend=backend):
# M3 error mitigation
sampler = Sampler(options=options)
job = sampler.run(circuits=qc, shots=4000)
How do I define such error mitigation schemes in Pennylane so that I can run it on IBM Quantum Hardware?