Qiskit / qiskit-tutorials

A collection of Jupyter notebooks showing how to use the Qiskit SDK
Apache License 2.0
2.3k stars 1.29k forks source link

Remove try/except in 07_grovers_algorithm #1396

Closed frankharkins closed 1 year ago

frankharkins commented 1 year ago

The Grover’s algorithm examples tutorial has some try/except blocks to catch missing libraries. For example:

oracle = None
try:
    oracle = PhaseOracle.from_dimacs_file(file_name)
except MissingOptionalLibraryError as ex:
    print(ex)

I assume this is so the notebook runs for users with missing libraries. If so, I recommend letting the code raise an error, as the notebook doesn't produce any useful results if missing the libraries.

Eric-Arellano commented 1 year ago

This would mean that we can't build the docs on those platforms like macOS ARM because tweedledum cannot be installed there. Ideally we could error in certain environments and not others.

In the meantime, our approach is to check our generated docs to make sure it worked properly.