Skip to content
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

Merged
merged 3 commits into from
Jun 11, 2021

Conversation

QFer
Copy link
Contributor

@QFer QFer commented Jun 3, 2021

  • 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

@QFer QFer requested a review from eendebakpt June 9, 2021 09:51
Copy link
Contributor

@peendebak peendebak left a 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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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"

Copy link
Contributor Author

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]},
Copy link
Contributor

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()
...

Copy link
Contributor Author

@QFer QFer Jun 10, 2021

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.

@QFer QFer merged commit d99bada into dev Jun 11, 2021
@QFer QFer deleted the fix/sds-301/damaged-projects branch June 11, 2021 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants