-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
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
[SDS-301] Fix for damaged projects and not enough classical bits #102
Conversation
QFer
commented
Jun 3, 2021
•
edited
Loading
edited
- Adjusted readthedocs for using version 3.8 of python
- Fix for damaged projects when error occured while post-processing the cQASM algorithm
- Check added during pre-processing for experiments where the number of classical bits is not enough to hold the measured qubits
- Removed format_vector method not used in notebook
- Renamed IPython to Jupyter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two minor comments, otherwise looks ok
number_of_classical_bits = measurements['number_of_clbits'] | ||
max_measurement_index = max(measurement[1] for measurement in measurements['measurements']) | ||
if max_measurement_index >= number_of_classical_bits: | ||
raise QisKitBackendError("Number of classical bits is not sufficient for storing the outcomes of the" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raise QisKitBackendError("Number of classical bits is not sufficient for storing the outcomes of the" | |
raise QisKitBackendError(f"Number of classical bits {number_of_classical_bits} is not sufficient for storing the outcomes of the" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
api.execute_qasm_async.return_value = quantum_inspire_job | ||
api.get_backend_type_by_name.return_value = {'max_number_of_shots': 4096} | ||
simulator = QuantumInspireBackend(api, Mock()) | ||
instructions = [{'name': 'h', 'qubits': [0]}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are all these instructions needed? This is internal qiskit format and prone to change. Could you not write this test by letting qiskit generarate similar data? E.g.
c=QuantumCircuit(3,3)
c.h(0)
c.h(2)
c.measure_all()
...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All these instructions are not necessary, I copied them from another test. Actually a measurement is enough, I changed that.
You are right that this is qiskit format but the easiest way to create sometimes specific instructions for the various test cases. For some test cases this is actually not needed, I added a ticket (SDS-371) to the SDK backlog to investigate this suggestion.