mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-04 08:50:41 +08:00
Improve validate solutions script & fix pre-commit error (#3253)
* Trying to time every solution * Proposal 2 for timing PE solutions: - Use pytest fixture along with --capture=no flag to print out the top DURATIONS slowest solution at the end of the test sessions. - Remove the print part and try ... except ... block from the test function. * Proposal 3 for timing PE solutions: Completely changed the way I was performing the tests. Instead of parametrizing the problem numbers and expected output, I will parametrize the solution file path. Steps: - Collect all the solution file paths - Convert the paths into a Python module - Call solution on the module - Assert the answer with the expected results For assertion, it was needed to convert the JSON list object to Python dictionary object which required changing the JSON file itself. * Add type hints for variables * Fix whitespace in single_qubit_measure
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
"""
|
||||
Build a simple bare-minimum quantum circuit that starts with a single
|
||||
qubit (by default, in state 0), runs the experiment 1000 times, and
|
||||
Build a simple bare-minimum quantum circuit that starts with a single
|
||||
qubit (by default, in state 0), runs the experiment 1000 times, and
|
||||
finally prints the total count of the states finally observed.
|
||||
Qiskit Docs: https://qiskit.org/documentation/getting_started.html
|
||||
"""
|
||||
|
Reference in New Issue
Block a user