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

Update docstring for QuantumProgram and add various type hints #135

Merged
merged 2 commits into from
Oct 20, 2023

Conversation

max-radin
Copy link
Collaborator

@max-radin max-radin commented Oct 6, 2023

Description

The QuantumProgram docstring was missing descriptions for some attributes. This PR addresses this and also adds type hints to a number of places.

Please verify that you have completed the following steps

  • I have self-reviewed my code.
  • I have included test cases validating introduced feature/fix.
  • I have updated documentation.

@max-radin max-radin requested a review from a team October 6, 2023 19:09
@github-actions
Copy link

github-actions bot commented Oct 6, 2023

🚀 Code Coverage

-------------------------------------------------------------------------------
You are using PYTHON: /home/runner/work/benchq/benchq/my_little_venv/bin/python3
Python Version: Python 3.9.18
Repository: https://github.com/zapatacomputing/benchq
Python Modules Covered: src.benchq/resource_estimation/graph src.benchq/algorithms/utils
-------------------------------------------------------------------------------
/home/runner/work/benchq/benchq/my_little_venv/bin/python3 -m coverage report --show-missing
Name                                                                    Stmts   Miss  Cover   Missing
-----------------------------------------------------------------------------------------------------
src/benchq/algorithms/gsee.py                                              17     17     0%   1-26
src/benchq/algorithms/ld_gsee.py                                           16      0   100%
src/benchq/algorithms/lde_solver.py                                       118     16    86%   143, 353-382
src/benchq/algorithms/lin_and_dong_qsp.py                                  34      0   100%
src/benchq/algorithms/qaoa.py                                              17      6    65%   47-50, 56-57
src/benchq/algorithms/time_evolution.py                                    29      0   100%
src/benchq/algorithms/utils/compression_gadget.py                          14      0   100%
src/benchq/algorithms/utils/convex_optimization.py                         41      3    93%   112-115
src/benchq/algorithms/utils/qsp_solver.py                                 191    182     5%   79-182, 203-225, 239-261, 277-284, 304-371, 395-426
src/benchq/block_encodings/block_encoding_utils.py                         40      0   100%
src/benchq/block_encodings/offset_tridiagonal.py                           27      0   100%
src/benchq/compilation/initialize_julia.py                                 14      0   100%
src/benchq/compilation/julia_utils.py                                      43      2    95%   82-83
src/benchq/compilation/pyliqtr_transpilation.py                            23      0   100%
src/benchq/compilation/rbs_hyperparam_tuning.py                            91     41    55%   87, 162-163, 211-221, 262-272, 313-323, 351-362, 393-419, 443-450
src/benchq/compilation/transpile_to_native_gates.py                        96      1    99%   107
src/benchq/conversions/_circuit_translations.py                            31      2    94%   53, 83
src/benchq/conversions/_openfermion_pyliqtr.py                             17      0   100%
src/benchq/data_structures/algorithm_implementation.py                     15      2    87%   23-24
src/benchq/data_structures/decoder.py                                      49      1    98%   116
src/benchq/data_structures/error_budget.py                                 19      0   100%
src/benchq/data_structures/graph_partition.py                              24      4    83%   21-24
src/benchq/data_structures/hardware_architecture_models.py                 73      4    95%   32, 36, 45, 186
src/benchq/data_structures/quantum_program.py                              55      2    96%   33, 75
src/benchq/data_structures/resource_info.py                                72      1    99%   97
src/benchq/mlflow/data_logging.py                                          42      1    98%   45
src/benchq/problem_embeddings/_qsp.py                                     115      2    98%   314, 316
src/benchq/problem_embeddings/_taylorization_lcu.py                       191     24    87%   52-56, 59, 77, 86-87, 96, 104, 165, 176-178, 261-266, 269, 279-283
src/benchq/problem_embeddings/_trotter.py                                  12      2    83%   13, 26
src/benchq/problem_ingestion/hamiltonian_from_file.py                      75      2    97%   94, 120
src/benchq/problem_ingestion/hamiltonian_generation.py                    118     65    45%   41, 56, 69-81, 85-94, 101-126, 130-152, 156-168, 172-179, 197-204
src/benchq/problem_ingestion/molecule_instance_generation.py              184     11    94%   122, 125, 131, 134, 153, 218, 238, 314-318, 498
src/benchq/problem_ingestion/vlasov.py                                     12      0   100%
src/benchq/resource_estimation/_compute_lambda.py                          18      0   100%
src/benchq/resource_estimation/_footprint_analysis.py                     105      2    98%   59, 277
src/benchq/resource_estimation/azure.py                                    44     31    30%   17, 58-64, 70-81, 91-124
src/benchq/resource_estimation/decoder_resource_estimator.py               30      0   100%
src/benchq/resource_estimation/default_pipelines.py                        54     30    44%   134-141, 178-185, 202-220, 257-298, 309-323
src/benchq/resource_estimation/graph/customizable_pipelines.py             38      2    95%   90-95
src/benchq/resource_estimation/graph/extrapolation_estimator.py            73      2    97%   78, 110
src/benchq/resource_estimation/graph/graph_estimator.py                   132     10    92%   142, 194, 222, 352-355, 370-379
src/benchq/resource_estimation/graph/transformers.py                       54      4    93%   75-81
src/benchq/resource_estimation/graph/worstcase_footprint_estimator.py      44      0   100%
src/benchq/resource_estimation/magic_state_distillation.py                 23      0   100%
src/benchq/resource_estimation/openfermion_re.py                           50      0   100%
src/benchq/timing.py                                                       17      0   100%
src/benchq/vizualization_tools.py                                          75     75     0%   4-171
-----------------------------------------------------------------------------------------------------
TOTAL                                                                    2672    547    80%

@max-radin max-radin enabled auto-merge (squash) October 20, 2023 14:15
@max-radin max-radin merged commit a59eea6 into main Oct 20, 2023
6 checks passed
@max-radin max-radin deleted the max-radin/DTA2-274/quantum-program-docstring branch October 20, 2023 15:03
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.

2 participants