From 089c3093371d2a7f739267c3b9cfa9af53695a55 Mon Sep 17 00:00:00 2001 From: Charles MOUSSA Date: Mon, 21 Oct 2024 11:54:25 +0200 Subject: [PATCH] change apply name --- pyqtorch/circuit.py | 2 +- pyqtorch/noise/readout.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyqtorch/circuit.py b/pyqtorch/circuit.py index 65b535ff..39fca28a 100644 --- a/pyqtorch/circuit.py +++ b/pyqtorch/circuit.py @@ -108,7 +108,7 @@ def sample( if self.readout_noise is None: return counters - return self.readout_noise.apply(counters, n_shots) + return self.readout_noise.apply_on_counts(counters, n_shots) class DropoutQuantumCircuit(QuantumCircuit): diff --git a/pyqtorch/noise/readout.py b/pyqtorch/noise/readout.py index 0e1c3d5a..5c1108c1 100644 --- a/pyqtorch/noise/readout.py +++ b/pyqtorch/noise/readout.py @@ -270,10 +270,10 @@ def apply_on_probas(self, batch_probs: Tensor, n_shots: int = 1000) -> Tensor: output_probs = torch.matmul(batch_probs, transition_matrix.T) return output_probs - def apply( + def apply_on_counts( self, counters: list[Counter | OrderedCounter] | Tensor, n_shots: int = 1000 ) -> list[Counter] | Tensor: - """_summary_ + """Apply readout on counters represented as Counters or Tensors. Args: counters (list[Counter | OrderedCounter] | Tensor): Samples of bit string as Counters.