From d8c4cb2b6338b643a587bbe40ad6f4bb40328aca Mon Sep 17 00:00:00 2001 From: Aidan Quinn Wilber-Gauthier Date: Wed, 31 Jul 2024 09:41:16 -0700 Subject: [PATCH 1/3] strip args before matching cloud noise ops --- pygsti/models/cloudnoisemodel.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pygsti/models/cloudnoisemodel.py b/pygsti/models/cloudnoisemodel.py index acca14f1c..fc50b4357 100644 --- a/pygsti/models/cloudnoisemodel.py +++ b/pygsti/models/cloudnoisemodel.py @@ -709,6 +709,7 @@ def _layer_component_cloudnoises(self, model, complbl_list, cache): else: for complbl in complbl_list: + complbl = complbl.strip_args() if complbl.collect_args() else complbl if complbl in cache: ret.append(cache[complbl]) # caches['cloudnoise-layers'] would hold "simplified" instrument members elif complbl in model.operation_blks['cloudnoise']: From 0d84bbf1cbd66b0be469bce38cdcba027ed03bf2 Mon Sep 17 00:00:00 2001 From: Aidan Quinn Wilber-Gauthier Date: Wed, 31 Jul 2024 09:43:21 -0700 Subject: [PATCH 2/3] embed ops to map sslbls --- pygsti/models/modelnoise.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pygsti/models/modelnoise.py b/pygsti/models/modelnoise.py index a4cc2c869..e586f2e60 100644 --- a/pygsti/models/modelnoise.py +++ b/pygsti/models/modelnoise.py @@ -537,7 +537,7 @@ def apply_errormap_stencil(self, stencil, evotype, state_space, target_labels=No # `None` in list signals a non-present direction => skip these terms sslbls_list = list(filter(lambda x: x is not None, sslbls_list)) for sslbls in sslbls_list: - op_to_embed = local_errormap if (sslbls is None or state_space.is_entire_space(sslbls)) \ + op_to_embed = local_errormap if (sslbls is None) \ else _op.EmbeddedOp(state_space, sslbls, local_errormap) embedded_errmaps.append(op_to_embed.copy() if copy else op_to_embed) From 7b68ea92ca2b8f3e291c4168295420cec9bdd668 Mon Sep 17 00:00:00 2001 From: "Stefan K. Seritan" Date: Tue, 8 Apr 2025 10:18:20 -0700 Subject: [PATCH 3/3] Bugfix for #568 --- pygsti/objectivefns/objectivefns.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pygsti/objectivefns/objectivefns.py b/pygsti/objectivefns/objectivefns.py index e97c7829d..b125d7727 100644 --- a/pygsti/objectivefns/objectivefns.py +++ b/pygsti/objectivefns/objectivefns.py @@ -4716,6 +4716,7 @@ def _hessian_from_block(self, hprobs, dprobs12, probs, element_slice, counts, to firsts, indicesWithOmitted = zip(*([(iel - element_slice.start, ic) for (iel, ic) in zip(self.firsts, self.indicesOfCircuitsWithOmittedData) if element_slice.start <= iel < element_slice.stop])) + firsts = list(firsts) #Allocate these above? Need to know block sizes of dprobs12 & hprobs... dprobs12_omitted_rowsum = _np.empty((len(firsts),) + dprobs12.shape[1:], 'd')