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.