Fix bug with auto-generated CNOT coherent error matrix in C++ simulator #318
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a bug with auto generated coherent error matrices for CNOT gates in the C++ simulator backend.
Description
The matrix auto-generated from noise parameters
"calibration_error"
and"zz_error"
was incorrect (one of the values was being put in the wrong matrix entry).This removes this part of parsing the code from the C++, which now only accepts a matrix for the
"U_error"
noise parameter. The conversion of the noise parameters"calibration_error"
(for CNOT and X90),"zz_error"
(for CNOT) and"detuning_error"
(for X90) into a"U_error"
matrix is now done in Python.I also fixed the old makefile for the simulator which was no longer compiling (@atilag this should be independent to building via cmake right?)
How Has This Been Tested?
I added some basic unit tests that the python generated coherent error matrices for the errors are correct.
For testing in the C++ code I added run-time test that the input matrix is unitary. If it is not unitary and the simulator will raise a runtime error which will be reported in the output json.
Types of changes
Checklist: