Skip to content

Commit

Permalink
Dta2-255 consistent naming (#139)
Browse files Browse the repository at this point in the history
* feat: refactor magic state distillation

* feat: make tests reflect new structure

* feat: rename upper level files

* fix: test file names

* fix: problem_embedding -> problem_embeddings

* feat: final organization of src

* fix: organize tests to reflect src

* fix: passes muster

* fix: isort issues

* fix: respond to PR comments

* fix: rename i<->e in heisenburg

* fix: forgot to save on previous commit
  • Loading branch information
Athena Caesura authored Jan 24, 2024
1 parent 8be8a3e commit dd6b2a7
Show file tree
Hide file tree
Showing 126 changed files with 2,059 additions and 6,848 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ github_actions-default:

# (no override)
style-fix:
black src tests examples benchmarks
black src tests examples benchmarks benchmarks
isort --profile=black src tests examples benchmarks

test:
Expand Down
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,25 @@ To run resource estimation using Azure Quantum Resource Estimation (QRE) tool, o
## Usage
See the [`examples`](examples) directory to learn more about how to use Bench-Q.

### Terminology Disambiguation

As fault-tolerant quantum computing is a relatively new field, there is no for several concepts which are crucial for resource estimation. We will try to clarify them here.

#### Problem Ingestion vs Problem Embedding vs Algorithm Implementation

`benchq` splits up the process of specifying a problem into three steps. The purpose of this is to split up the more complex parts of the process into more digestable, modular parts. The three steps are:

##### Problem ingestion

Take an input representing a problem instance and outputs data that needs to be loaded into the quantum computer. (e.g. the Hamiltonian we are simulating)

##### Problem embedding
Take the data from the problem ingestion step and embed it into a quantum circuit. (e.g. the block encoding circuit.) This can be a complicated process involving arithmetic and specialized compilation.

##### Algorithm implementation
Take the circuit from the problem embedding step and implement the algorithm. Also requires information from the problem instance to determine how to budget errors throughout the computation. (e.g. the required accuracy of the algorithm.)


## Running benchmarks

Because quantum compilation and resource estimation can be compute intensive, Bench-Q includes tools for benchmarking components that are potential bottlenecks. To run the benchmarks, execute the command
Expand Down
14 changes: 5 additions & 9 deletions benchmarks/test_get_qsp_program.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,8 @@

from benchq.algorithms.time_evolution import _n_block_encodings_for_time_evolution
from benchq.problem_embeddings import get_qsp_program
from benchq.problem_ingestion import (
generate_jw_qubit_hamiltonian_from_mol_data,
get_hamiltonian_from_file,
get_vlasov_hamiltonian,
)
from benchq.problem_ingestion.molecule_instance_generation import (
from benchq.problem_ingestion import get_hamiltonian_from_file, get_vlasov_hamiltonian
from benchq.problem_ingestion.molecule_hamiltonians import (
generate_hydrogen_chain_instance,
)

Expand Down Expand Up @@ -44,9 +40,9 @@ def jw_test_case():
failure_tolerance = 1e-3
n_hydrogens = 2

operator = generate_jw_qubit_hamiltonian_from_mol_data(
generate_hydrogen_chain_instance(n_hydrogens)
)
operator = generate_hydrogen_chain_instance(
n_hydrogens
).get_active_space_hamiltonian()

n_block_encodings = _n_block_encodings_for_time_evolution(
operator, evolution_time, failure_tolerance
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/test_substrate_scheduler_performance.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import networkx as nx
import pytest

from benchq.resource_estimation.graph import substrate_scheduler
from benchq.resource_estimators.graph_estimators import substrate_scheduler


@pytest.mark.parametrize("preset", ["fast", "optimized"])
Expand Down
Loading

0 comments on commit dd6b2a7

Please sign in to comment.