Source code for graphix.noise_models.noiseless_noise_model
"""Noise model that introduces no errors.This class is useful for unit tests or benchmarks where deterministicbehaviour is required. All methods simply return an identity:class:`~graphix.channels.KrausChannel`."""from__future__importannotationsfromtypingimportTYPE_CHECKINGimportnumpyasnpimporttyping_extensionsfromgraphix.channelsimportKrausChannel,KrausDatafromgraphix.noise_models.noise_modelimportNoiseModelifTYPE_CHECKING:fromgraphix.measurementsimportOutcome
[docs]classNoiselessNoiseModel(NoiseModel):"""Noise model that performs no operation."""
[docs]@typing_extensions.overridedefentangle(self)->KrausChannel:"""Return the identity channel for entangling operations. Returns ------- KrausChannel Identity channel :math:`I_4`. """returnKrausChannel([KrausData(1.0,np.eye(4))])
[docs]@typing_extensions.overridedefmeasure(self)->KrausChannel:"""Return the identity channel for measurements. Returns ------- KrausChannel Identity channel :math:`I_2`. """returnKrausChannel([KrausData(1.0,np.eye(2))])
[docs]@typing_extensions.overridedefconfuse_result(self,result:Outcome)->Outcome:"""Return the unmodified measurement result. Parameters ---------- result : bool Ideal measurement outcome. Returns ------- bool Same as ``result``. """returnresult
[docs]@typing_extensions.overridedefbyproduct_x(self)->KrausChannel:"""Return the identity channel for X corrections. Returns ------- KrausChannel Identity channel :math:`I_2`. """returnKrausChannel([KrausData(1.0,np.eye(2))])
[docs]@typing_extensions.overridedefbyproduct_z(self)->KrausChannel:"""Return the identity channel for Z corrections. Returns ------- KrausChannel Identity channel :math:`I_2`. """returnKrausChannel([KrausData(1.0,np.eye(2))])
[docs]@typing_extensions.overridedefclifford(self)->KrausChannel:"""Return the identity channel for Clifford gates. Returns ------- KrausChannel Identity channel :math:`I_2`. """returnKrausChannel([KrausData(1.0,np.eye(2))])
[docs]@typing_extensions.overridedeftick_clock(self)->None:"""Advance the simulator clock without applying errors. Notes ----- This method is present for API compatibility and does not modify the internal state. See :meth:`~graphix.noise_models.noise_model.NoiseModel.tick_clock`. """