问题描述
我可以轻松添加使用Qiskit创建的任何单一门,但是当我尝试将这些旋转门添加到噪声模型基础门时会发出警告。标签可能有问题(我使用了“ rx”和“ ry”)或其他一些我无法弄清楚的问题。
问题在于,除非我将它们添加到基本门中,否则噪声不会影响这些门。
noise_model = NoiseModel()
error_1 = depolarizing_error(prob_1,1)
error_2 = depolarizing_error(prob_2,2)
noise_model.add_all_qubit_quantum_error(phase_damping_error(0.1),['Z1','Z2','rx','ry','h'])
noise_model.add_all_qubit_quantum_error(phase_damping_error(0.1),['CZϕA','CZϕB'])
noise_model.add_basis_gates(['unitary','ry'])
basis_gates = noise_model.basis_gates
circs = transpile([qc1,qc2,qc3],basis_gates=basis_gates)
result_error = execute(circs,QasmSimulator(),shots=10,noise_model=noise_model,basis_gates=basis_gates).result()
print(noise_model)
Warning: Adding a gate "rx" to basis_gates which is not in QasmSimulator basis_gates.
Warning: Adding a gate "ry" to basis_gates which is not in QasmSimulator basis_gates.
NoiseModel:
Basis gates: ['cx','h','id','u3','unitary']
Instructions with noise: ['CZϕB','CZϕA','Z1']
All-qubits errors: ['Z1','CZϕB']
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)