Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
55da605
main changes (breaks some calling functions elsewhere)
rileyjmurray May 22, 2024
21eb037
Initial implementation of caching for layout creation
May 22, 2024
f82655a
check in
rileyjmurray May 23, 2024
d0e1bde
remove change that wasnt strictly in-scope for the PR
rileyjmurray May 23, 2024
b932571
remove changes that werent strictly necessary
rileyjmurray May 23, 2024
4f47d1f
tests pass
rileyjmurray May 23, 2024
2cd29ab
remove is_normal function
rileyjmurray May 23, 2024
14c444b
add a comment and remove unused imports
rileyjmurray May 23, 2024
66e7f78
Merge branch 'feature-faster-circuit-primitives' into feature-faster-…
May 29, 2024
9bc47bc
Add caching for spam-free circuit expansion
May 29, 2024
bbf29ab
Improve SeparatePOVMCircuit internals
May 30, 2024
a79ac03
New method for doing bulk intrument/effect expansion
May 30, 2024
d97f786
Minor COPA Layout __init__ tweaks
May 30, 2024
544fb55
Refactor some OrderedDicts into regular ones
May 30, 2024
1d4e5a0
Merge branch 'feature-faster-circuit-primitives' into feature-faster-…
May 31, 2024
91d5ebb
Start the process of adding caching to MDC store creation
Jun 1, 2024
cfb323a
Tweak omitted freqs and counts + DataSet and slicetools
Jun 3, 2024
e8e7004
Fix dataset bug
Jun 3, 2024
aa22c3c
Another minor bugfix caught by testing
Jun 3, 2024
be80255
Another minor bugfix caught by testing
Jun 3, 2024
ff13da6
Update test_stdinputparser.py
Jun 3, 2024
81bdacb
Merge branch 'feature-faster-circuit-primitives' into feature-faster-…
Jun 4, 2024
f8c5840
Fix indentation error
Jun 5, 2024
0417c20
Faster implementation of __getitem__
Jun 5, 2024
c39101d
Implement caching for map layout creation
Jun 5, 2024
6cc69bc
Fix bugs in new extract_labels implementation
Jun 5, 2024
1ff8aeb
Finish refactoring expand_instruments_and_separate_povm
Jun 5, 2024
5db3e59
Refactor expand_instruments_and_separate_povm
Jun 5, 2024
7f7a08d
Merge branch 'feature-faster-circuit-primitives' into feature-faster-…
Jun 5, 2024
53e2da6
Refactor cache creation functions
Jun 5, 2024
071fa29
Merge branch 'develop' into improved-matrixtools
rileyjmurray Jun 13, 2024
fde0dfa
Merge branch 'develop' into improved-matrixtools
rileyjmurray Jun 13, 2024
4682043
tweak stateless_data
rileyjmurray Jun 24, 2024
b0c630a
logging
rileyjmurray Jun 24, 2024
62f37ec
add trivial __getstate__ and __setstate__ needed for serialization
rileyjmurray Jul 16, 2024
f3bfb80
remove some logging and profiling code (well, just comment out)
rileyjmurray Jul 16, 2024
b735201
Merge branch 'develop' into feature-faster-layout-creation
Jul 25, 2024
74dc215
Minor updates and unit test fixes
Jul 30, 2024
6f4af73
Add in DataSet key aliasing
Jul 31, 2024
e7bad83
Minor refactors and updates
Jul 31, 2024
e0d3c47
Unrelated RB testing fix
Jul 31, 2024
ad7c064
Add guardrails around public model attributes
Aug 31, 2024
310c53e
Unrelated circuit bugfix
Sep 3, 2024
cfd9aff
Add warning about parameter bound rebuild behavior
Sep 5, 2024
0c696a7
Initial Implementation For Few Parameter Updates
Sep 11, 2024
31f99c5
Update MapForwardSimulator to use lazier updates
Sep 11, 2024
e548476
Further vectorization of LindbladCoefficientBlock from_vector
Sep 11, 2024
40bbb91
Update jacobian calculation in MatrixForwardSimulator
Sep 11, 2024
f14ecec
Method For Circuit Parameter Dependence
Sep 11, 2024
4e275fa
Merge branch 'feature-faster-layout-creation' into feature-lazier-mod…
Sep 11, 2024
e670aeb
Allow SIGINT set to be skipped via env variable.
sserita Sep 12, 2024
f93fd3c
Logic bugfix
sserita Sep 12, 2024
2fb4c44
Add circuit parameter lazifications
Sep 14, 2024
4b44ed5
Initial pass at updated cython implementation
Sep 15, 2024
acc9e91
Cython microoptimizations
Sep 16, 2024
3136d9b
Revert circuit parameter dependence cython
Sep 16, 2024
549f901
Fix a bug with parameter label management for interposers
Sep 19, 2024
2af7e11
Fix a serialization bug for trivial gauge optimizations
Sep 19, 2024
db5f4b4
Bugfix for deterministic Clifford RB test.
sserita Sep 19, 2024
c1f97f8
Merge pull request #489 from sandialabs/bugfix-guard-signal
sserita Sep 19, 2024
76ff5bf
Make test_rb paths absolute.
sserita Sep 19, 2024
74648a6
Merge pull request #488 from sandialabs/bugfix-esplodeded-fogi-labels
sserita Sep 19, 2024
2f61126
Merge pull request #448 from sandialabs/feature-faster-layout-creation
sserita Sep 19, 2024
548703b
Fix beta tests.
sserita Sep 19, 2024
f16e5f6
Merge branch 'develop' into bugfix-model-parameters
sserita Sep 19, 2024
ac5d78e
Merge resolution with #488.
sserita Sep 19, 2024
3e2fa7c
Merge pull request #482 from sandialabs/bugfix-model-parameters
sserita Sep 19, 2024
1aeb626
Removing QIBO evotype.
sserita Sep 19, 2024
e50ce2b
directx and other minor removals.
sserita Sep 19, 2024
bd43e31
Remove directx tests.
sserita Sep 19, 2024
2cc7ae2
Merge pull request #490 from sandialabs/feature-qibo-deprecation
sserita Sep 20, 2024
ba3868b
interpygate helpers
rileyjmurray Sep 24, 2024
65d25f9
remove safe_dot
rileyjmurray Sep 24, 2024
cfe2417
Merge pull request #442 from sandialabs/improved-matrixtools
sserita Sep 24, 2024
eacea59
Fix beta tests
sserita Sep 24, 2024
67ae76b
Revamp PrefixTable
Sep 27, 2024
dcea6b8
Performance improvements for tree partitioning
Sep 28, 2024
b69c44e
Change default atom heuristic
Sep 28, 2024
6c076e7
Spring cleaning
Sep 28, 2024
8ee1027
Improved performance for errorgen updates
Sep 28, 2024
3f59ec6
Clean up composedeffect
Sep 28, 2024
349c532
Further refinements to set_parameter_values
Sep 28, 2024
9e6b94f
PrefixTable Tweaks for Multiple Preps
Sep 28, 2024
d6deda1
Add option to update parameters by name
Sep 29, 2024
5f34a9a
Fix an inefficiency in dm_mapfill_probs
Sep 30, 2024
81ced99
Minor tweak to effectcrep
Sep 30, 2024
5b0b2f4
Add pickle handling for circuits
Oct 1, 2024
77aaf61
Attempt at making PrefixTable deterministic
Oct 4, 2024
c14b090
Revert "Fix an inefficiency in dm_mapfill_probs"
Oct 4, 2024
119e968
Merge branch 'develop' into feature-lazier-model-param-updates
Oct 5, 2024
12c9252
Add parameter interposer checks
Oct 22, 2024
ce983fc
Update the default atom heuristic
Oct 22, 2024
383e4bd
Remove some debug bindings
Oct 22, 2024
5c5b06a
First pass at updating default evotype behavior
Oct 22, 2024
bdcca50
Fix cast bug
Oct 22, 2024
ec27fa7
Change default cache size
Oct 22, 2024
6ff5d59
tweak stateless_data
rileyjmurray Jun 24, 2024
1344608
logging
rileyjmurray Jun 24, 2024
3ba841d
add trivial __getstate__ and __setstate__ needed for serialization
rileyjmurray Jul 16, 2024
001ea1b
remove some logging and profiling code (well, just comment out)
rileyjmurray Jul 16, 2024
1cf25e3
fix enable_backward=True handling. Add a function for evaluating circ…
rileyjmurray Nov 7, 2024
c16213a
Merge branch 'faster-torch-rebased' into faster-torch
rileyjmurray Jul 24, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ doc/build
*gst_checkpoints*
*model_test_checkpoints*
*standard_gst_checkpoints*
*ibmqexperiment_checkpoint*

# Serialization Testing Artifacts #
###################################
Expand All @@ -43,6 +44,7 @@ test/output/pylint/*
test/output/individual_coverage/*/*
test/test_packages/cmp_chk_files/Fake_Dataset_none.txt.cache
**.noseids
**test_ibmq**

# Tutorial Notebook Untracked Files #
####################################
Expand Down
1 change: 0 additions & 1 deletion optional-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,4 @@ cython
cvxopt
cvxpy
seaborn
qibo
packaging
41 changes: 0 additions & 41 deletions packages/pygsti/__init__.py

This file was deleted.

49 changes: 30 additions & 19 deletions pygsti/algorithms/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
from pygsti.baseobjs.resourceallocation import ResourceAllocation as _ResourceAllocation
from pygsti.optimize.customlm import CustomLMOptimizer as _CustomLMOptimizer
from pygsti.optimize.customlm import Optimizer as _Optimizer
from pygsti import forwardsims as _fwdsims
from pygsti import layouts as _layouts

_dummy_profiler = _DummyProfiler()

Expand Down Expand Up @@ -400,7 +402,7 @@ def _construct_ab(prep_fiducials, effect_fiducials, model, dataset, op_label_ali
for j, rhostr in enumerate(prep_fiducials):
opLabelString = rhostr + estr # LEXICOGRAPHICAL VS MATRIX ORDER
dsStr = opLabelString.replace_layers_with_aliases(op_label_aliases)
expd_circuit_outcomes = opLabelString.expand_instruments_and_separate_povm(model)
expd_circuit_outcomes = model.expand_instruments_and_separate_povm(opLabelString)
assert(len(expd_circuit_outcomes) == 1), "No instruments are allowed in LGST fiducials!"
unique_key = next(iter(expd_circuit_outcomes.keys()))
outcomes = expd_circuit_outcomes[unique_key]
Expand Down Expand Up @@ -429,7 +431,7 @@ def _construct_x_matrix(prep_fiducials, effect_fiducials, model, op_label_tuple,
for j, rhostr in enumerate(prep_fiducials):
opLabelString = rhostr + _circuits.Circuit(op_label_tuple, line_labels=rhostr.line_labels) + estr
dsStr = opLabelString.replace_layers_with_aliases(op_label_aliases)
expd_circuit_outcomes = opLabelString.expand_instruments_and_separate_povm(model)
expd_circuit_outcomes = model.expand_instruments_and_separate_povm(opLabelString)
dsRow_fractions = dataset[dsStr].fractions
assert(len(expd_circuit_outcomes) == nVariants)

Expand Down Expand Up @@ -677,16 +679,10 @@ def run_gst_fit(mdc_store, optimizer, objective_function_builder, verbosity=0):
if _np.linalg.norm(mdc_store.model.to_vector() - v_cmp) > 1e-6:
raise ValueError("MPI ERROR: *different* MC2GST start models"
" given to different processors!") # pragma: no cover

#MEM from ..baseobjs.profiler import Profiler
#MEM debug_prof = Profiler(comm)
#MEM debug_prof.print_memory("run_gst_fit1", True)


if objective_function_builder is not None:
objective_function_builder = _objfns.ObjectiveFunctionBuilder.cast(objective_function_builder)
#MEM debug_prof.print_memory("run_gst_fit2", True)
objective = objective_function_builder.build_from_store(mdc_store, printer) # (objective is *also* a store)
#MEM debug_prof.print_memory("run_gst_fit3", True)
else:
assert(isinstance(mdc_store, _objfns.ObjectiveFunction)), \
"When `objective_function_builder` is None, `mdc_store` must be an objective fn!"
Expand All @@ -705,14 +701,8 @@ def run_gst_fit(mdc_store, optimizer, objective_function_builder, verbosity=0):

printer.log("Completed in %.1fs" % (_time.time() - tStart), 1)

#if target_model is not None:
# target_vec = target_model.to_vector()
# targetErrVec = _objective_func(target_vec)
# return minErrVec, soln_gs, targetErrVec
profiler.add_time("do_mc2gst: total time", tStart)
#TODO: evTree.permute_computation_to_original(minErrVec) #Doesn't work b/c minErrVec is flattened
# but maybe best to just remove minErrVec from return value since this isn't very useful
# anyway?

return opt_result, objective


Expand Down Expand Up @@ -888,10 +878,30 @@ def _max_array_types(artypes_list): # get the maximum number of each array type
#The ModelDatasetCircuitsStore
printer.log('Precomputing CircuitOutcomeProbabilityArray layouts for each iteration.', 2)
precomp_layouts = []

#pre-compute a dictionary caching completed circuits for layout construction performance.
unique_circuits = list({ckt for circuit_list in circuit_lists for ckt in circuit_list})
if isinstance(mdl.sim, (_fwdsims.MatrixForwardSimulator, _fwdsims.MapForwardSimulator)):
precomp_layout_circuit_cache = mdl.sim.create_copa_layout_circuit_cache(unique_circuits, mdl, dataset=dataset)
else:
precomp_layout_circuit_cache = None

for i, circuit_list in enumerate(circuit_lists):
printer.log(f'Layout for iteration {i}', 2)
precomp_layouts.append(mdl.sim.create_layout(circuit_list, dataset, resource_alloc, array_types, verbosity= printer - 1))

precomp_layouts.append(mdl.sim.create_layout(circuit_list, dataset, resource_alloc, array_types, verbosity= printer - 1,
layout_creation_circuit_cache = precomp_layout_circuit_cache))

#precompute a cache of possible outcome counts for each circuits to accelerate MDC store creation
if isinstance(mdl, _models.model.OpModel):
if precomp_layout_circuit_cache is not None: #then grab the split circuits from there.
expanded_circuit_outcome_list = mdl.bulk_expand_instruments_and_separate_povm(unique_circuits,
completed_circuits= precomp_layout_circuit_cache['completed_circuits'].values())
else:
expanded_circuit_outcome_list = mdl.bulk_expand_instruments_and_separate_povm(unique_circuits)
outcome_count_by_circuit_cache = {ckt: len(outcome_tup) for ckt,outcome_tup in zip(unique_circuits, expanded_circuit_outcome_list)}
else:
outcome_count_by_circuit_cache = {ckt: mdl.compute_num_outcomes(ckt) for ckt in unique_circuits}

with printer.progress_logging(1):
for i in range(starting_index, len(circuit_lists)):
circuitsToEstimate = circuit_lists[i]
Expand All @@ -908,7 +918,8 @@ def _max_array_types(artypes_list): # get the maximum number of each array type
mdl.basis = start_model.basis # set basis in case of CPTP constraints (needed?)
initial_mdc_store = _objfns.ModelDatasetCircuitsStore(mdl, dataset, circuitsToEstimate, resource_alloc,
array_types=array_types, verbosity=printer - 1,
precomp_layout = precomp_layouts[i])
precomp_layout = precomp_layouts[i],
outcome_count_by_circuit=outcome_count_by_circuit_cache)
mdc_store = initial_mdc_store

for j, obj_fn_builder in enumerate(iteration_objfn_builders):
Expand Down
Loading
Loading