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

Improve performance of GST #305

Merged
merged 3 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
10 changes: 5 additions & 5 deletions pygsti/modelmembers/operations/lindbladcoefficients.py
Original file line number Diff line number Diff line change
Expand Up @@ -817,10 +817,10 @@ def from_vector(self, v):
# cache_mx[i,i] = params[i,i]
# cache_mx[i,j] = params[i,j] + 1j*params[j,i] (i > j)
cache_mx = self._cache_mx
iparams = 1j * params
for i in range(num_bels):
cache_mx[i, i] = params[i, i]
for j in range(i):
cache_mx[i, j] = params[i, j] + 1j * params[j, i]
cache_mx[i, :i] = params[i, :i] + iparams[:i, i]

#The matrix of (complex) "other"-coefficients is build by assuming
# cache_mx is its Cholesky decomp; means otherCoeffs is pos-def.
Expand All @@ -839,11 +839,11 @@ def from_vector(self, v):

elif self._param_mode == "elements": # params mx stores block_data (hermitian) directly
#params holds block_data real and imaginary parts directly
iparams = 1j * params
for i in range(num_bels):
self.block_data[i, i] = params[i, i]
for j in range(i):
self.block_data[i, j] = params[i, j] + 1j * params[j, i]
self.block_data[j, i] = params[i, j] - 1j * params[j, i]
self.block_data[i, :i] = params[i, :i] + iparams[:i, i]
self.block_data[:i, i] = params[i, :i] - iparams[:i, i]
else:
raise ValueError("Internal error: invalid parameter mode (%s) for block type %s!"
% (self._param_mode, self._block_type))
Expand Down
2 changes: 1 addition & 1 deletion pygsti/objectivefns/objectivefns.py
Original file line number Diff line number Diff line change
Expand Up @@ -4561,7 +4561,7 @@ def _omitted_prob_first_terms(self, probs):
-------
numpy.ndarray
"""
omitted_probs = 1.0 - _np.array([_np.sum(probs[self.layout.indices_for_index(i)])
omitted_probs = 1.0 - _np.array([probs[self.layout.indices_for_index(i)].sum()
for i in self.indicesOfCircuitsWithOmittedData])
return self.raw_objfn.zero_freq_terms(self.total_counts[self.firsts], omitted_probs)

Expand Down