We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Qiskit permits noise to be added to particular gates, for example as follows:
from qiskit import QuantumCircuit from qiskit_aer import AerSimulator from qiskit_aer.noise import NoiseModel, depolarizing_error from qiskit.extensions import UnitaryGate error = depolarizing_error(0.1, 1) noise_model = NoiseModel() noise_model.add_quantum_error(error, 'my_gate', [0]) noise_model.add_basis_gates(['unitary']) matrix = [[0,1], [1,0]] gate = UnitaryGate(matrix, label='my_gate') circ = QuantumCircuit(1) circ.append(gate, [0]) circ.measure_all() backend = AerSimulator(noise_model=noise_model) noise_result = backend.run(circ).result() noise_result.get_counts()
giving in one instance:
{'0': 46, '1': 978}
as expected. It seems that it's not straightforward to do the same with pytket with something very simple like:
from pytket.extensions.qiskit import AerBackend tket_backend = AerBackend(noise_model=noise_model)
giving an error ending in:
File /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pytket/extensions/qiskit/backends/aer.py:591, in _process_noise_model(noise_model, gate_set) 589 if len(qubits) == 1: 590 [q] = qubits --> 591 optype = _gate_str_2_optype[name] 592 qubits_set.add(q) 593 if error["type"] == "qerror": KeyError: 'my_gate'
Being able to add noise to particular gates would be a great feature to have!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Qiskit permits noise to be added to particular gates, for example as follows:
giving in one instance:
as expected. It seems that it's not straightforward to do the same with pytket with something very simple like:
giving an error ending in:
Being able to add noise to particular gates would be a great feature to have!
The text was updated successfully, but these errors were encountered: