Source code for graphix.noise_models.noiseless_noise_model
"""Noiseless noise model for testing."""from__future__importannotationsimportnumpyasnpfromgraphix.channelsimportKrausChannel,KrausDatafromgraphix.noise_models.noise_modelimportNoiseModel
[docs]classNoiselessNoiseModel(NoiseModel):"""Noiseless noise model for testing. Only return the identity channel. """
[docs]defprepare_qubit(self):"""Return the channel to apply after clean single-qubit preparation. Here just identity."""returnKrausChannel([KrausData(1.0,np.eye(2))])
[docs]defentangle(self):"""Return noise model to qubits that happens after the CZ gates."""returnKrausChannel([KrausData(1.0,np.eye(4))])
[docs]defmeasure(self):"""Apply noise to qubit to be measured."""returnKrausChannel([KrausData(1.0,np.eye(2))])