Skip to content

Commit 88ea840

Browse files
committed
part b
1 parent 80dfbac commit 88ea840

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

qualtran/resource_counting/_costing.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,11 @@ def _get_cost_value(
134134
return static_cost
135135

136136
# Strategy 3: Compute
137-
# part a. set up caching of computed costs. Using the callable will use the cache if possible
138-
# and only recurse if the bloq has not been seen before. The result of a computation
139-
# will be cached.
137+
# part a. set up caching of computed costs by currying the costs_cache.
140138
def _get_cost_val_internal(callee: 'Bloq'):
141139
return _get_cost_value(callee, cost_key, costs_cache=costs_cache, generalizer=generalizer)
142140

141+
# part b. call the compute method and cache the result.
143142
tstart = time.perf_counter()
144143
computed_cost = cost_key.compute(bloq, _get_cost_val_internal)
145144
tdur = time.perf_counter() - tstart

0 commit comments

Comments
 (0)