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

Ac/dta2 270 implement pauli tracker #150

Merged
merged 55 commits into from
May 15, 2024

Conversation

AthenaCaesura
Copy link
Contributor

Description

This PR implements the full compilation routine in Julia (with a skeleton substrate scheduler)

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.

@AthenaCaesura AthenaCaesura marked this pull request as ready for review March 29, 2024 15:16
Copy link

github-actions bot commented Mar 29, 2024

🚀 Code Coverage

-------------------------------------------------------------------------------
You are using PYTHON: my_little_venv/bin/python3
Python Version: Python 3.11.9
Repository: https://github.com/zapatacomputing/benchq
Python Modules Covered: src.benchq/compilation/circuits src.benchq/compilation/graph_states src.benchq/algorithms/gsee src.benchq/algorithms/data_structures src.benchq/problem_ingestion/plasma_hamiltonians src.benchq/problem_ingestion/solid_state_hamiltonians src.benchq/problem_ingestion/molecular_hamiltonians src.benchq/problem_embeddings/trotter src.benchq/problem_embeddings/qaoa src.benchq/problem_embeddings/qsp src.benchq/problem_embeddings/block_encodings src.benchq/problem_embeddings/time_marching
-------------------------------------------------------------------------------
my_little_venv/bin/python3 -m coverage report --show-missing
Name                                                                                    Stmts   Miss  Cover   Missing
---------------------------------------------------------------------------------------------------------------------
src/benchq/algorithms/data_structures/algorithm_implementation.py                          20      1    95%   37
src/benchq/algorithms/data_structures/error_budget.py                                      19      0   100%
src/benchq/algorithms/gsee/ld_gsee.py                                                      16      0   100%
src/benchq/algorithms/gsee/qpe_gsee.py                                                     16     16     0%   1-24
src/benchq/algorithms/profolio_optimization.py                                              6      6     0%   4-27
src/benchq/algorithms/time_evolution.py                                                    30      0   100%
src/benchq/compilation/circuits/compile_to_native_gates.py                                121      1    99%   149
src/benchq/compilation/circuits/pyliqtr_transpilation.py                                   32      0   100%
src/benchq/compilation/graph_states/circuit_compilers.py                                   36     15    58%   14-19, 92-93, 97-104
src/benchq/compilation/graph_states/compiled_data_structures.py                            54      1    98%   104
src/benchq/compilation/graph_states/implementation_compiler.py                             42      4    90%   86-89
src/benchq/compilation/graph_states/initialize_julia.py                                    14      0   100%
src/benchq/compilation/graph_states/substrate_scheduler/python_substrate_scheduler.py      30      6    80%   36, 44, 52, 57-59
src/benchq/conversions/_circuit_translations.py                                            28      1    96%   53
src/benchq/conversions/_openfermion_pyliqtr.py                                             18      0   100%
src/benchq/conversions/_operator_translations.py                                           30      4    87%   35, 40, 45, 58
src/benchq/decoder_modeling/decoder.py                                                     48      1    98%   116
src/benchq/decoder_modeling/decoder_resource_estimator.py                                  30      0   100%
src/benchq/magic_state_distillation/autoccz_factories.py                                   45      0   100%
src/benchq/magic_state_distillation/litinski_factories.py                                   9      0   100%
src/benchq/magic_state_distillation/magic_state_factory.py                                 10      0   100%
src/benchq/magic_state_distillation/small_footprint_factories.py                            8      8     0%   1-79
src/benchq/mlflow/data_logging.py                                                          45      1    98%   43
src/benchq/problem_embeddings/block_encodings/double_factorized_hamiltonian.py             14      0   100%
src/benchq/problem_embeddings/block_encodings/offset_tridiagonal.py                        27      0   100%
src/benchq/problem_embeddings/block_encodings/offset_tridiagonal_utils.py                  40      0   100%
src/benchq/problem_embeddings/qaoa/_qaoa.py                                                14      4    71%   47-50
src/benchq/problem_embeddings/qpe.py                                                       29      0   100%
src/benchq/problem_embeddings/qsp/_lin_and_dong_qsp.py                                     34      0   100%
src/benchq/problem_embeddings/qsp/_qsp.py                                                 114      2    98%   313, 315
src/benchq/problem_embeddings/qsp/get_qsp_phases.py                                       193    184     5%   79-182, 203-225, 239-261, 277-284, 304-371, 397-428
src/benchq/problem_embeddings/qsp/get_qsp_polynomial.py                                    42      3    93%   112-115
src/benchq/problem_embeddings/quantum_program.py                                          106     28    74%   42, 56-59, 78, 86, 96, 143-149, 152-155, 169-176, 184-188
src/benchq/problem_embeddings/time_marching/_time_marching.py                             107     14    87%   75, 287-314
src/benchq/problem_embeddings/time_marching/compression_gadget.py                          13      0   100%
src/benchq/problem_embeddings/time_marching/matrix_properties.py                           13      0   100%
src/benchq/problem_embeddings/trotter/_trotter.py                                          12      2    83%   13, 26
src/benchq/problem_ingestion/hamiltonian_from_file.py                                      74      2    97%   94, 120
src/benchq/problem_ingestion/molecular_hamiltonians/_common_molecules.py                   13      0   100%
src/benchq/problem_ingestion/molecular_hamiltonians/_compute_lambda.py                     18      0   100%
src/benchq/problem_ingestion/molecular_hamiltonians/_hamiltonian_generation.py            161     11    93%   136, 139, 145, 148, 167, 230, 240, 322-324, 539
src/benchq/problem_ingestion/plasma_hamiltonians/vlasov.py                                 12      0   100%
src/benchq/problem_ingestion/solid_state_hamiltonians/fermi_hubbard.py                      7      3    57%   17-29
src/benchq/problem_ingestion/solid_state_hamiltonians/heisenberg.py                        20     14    30%   19-44
src/benchq/problem_ingestion/solid_state_hamiltonians/ising.py                             90     43    52%   17-24, 42-49, 53-75, 79-91
src/benchq/quantum_hardware_modeling/devitt_surface_code.py                                14      0   100%
src/benchq/quantum_hardware_modeling/fowler_surface_code.py                                 7      0   100%
src/benchq/quantum_hardware_modeling/hardware_architecture_models.py                       69      4    94%   31, 35, 44, 188
src/benchq/resource_estimators/azure_estimator.py                                          42     29    31%   19, 58-73, 86-119
src/benchq/resource_estimators/default_estimators.py                                       69     43    38%   129-131, 164, 178-192, 234-281, 292-309
src/benchq/resource_estimators/graph_estimator.py                                         122      9    93%   115, 314, 378-382, 400-412
src/benchq/resource_estimators/openfermion_estimator.py                                    62      2    97%   65, 169
src/benchq/resource_estimators/resource_info.py                                            61      0   100%
src/benchq/timing.py                                                                       17      0   100%
src/benchq/visualization_tools/plot_graph_state.py                                         76     69     9%   19-230
src/benchq/visualization_tools/plot_substrate_scheduling.py                                28     15    46%   26-47
src/benchq/visualization_tools/resource_allocation.py                                     137     59    57%   112-115, 119-143, 146-220, 264, 272-278
---------------------------------------------------------------------------------------------------------------------
TOTAL                                                                                    2564    605    76%

setup.cfg Outdated Show resolved Hide resolved
@AthenaCaesura AthenaCaesura force-pushed the ac/DTA2-270-implement-pauli-tracker branch from a5253bd to 443c798 Compare April 18, 2024 19:29

# transformed the counts from the qiskit simulation into a real pdf; some really ugly
# bit shifting (and similar) is necessary here
def counts_to_pdf(bits, counts):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not something we need to address in this PR, but I just wanted to note that we could probably simplify this logic in the future. For example by using some of the functionality in orquestra-quantum or by doing checks on the counts dict rather than the pdf.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh yeah, we definitely should...

@AthenaCaesura AthenaCaesura merged commit adb12c5 into main May 15, 2024
6 checks passed
@AthenaCaesura AthenaCaesura deleted the ac/DTA2-270-implement-pauli-tracker branch May 15, 2024 17:06
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.

3 participants