public static bool TryGetByName(string name, [NotNullWhen(true)] out NoiseModel?model) { try { model = NativeInterface.GetNoiseModelByName(name); return(true); } catch (SimulationException) { model = null; return(false); } }
public void GetNoiseModelByNameThrowsExceptionForInvalidNames() { Assert.Throws <SimulationException>(() => { NativeInterface.GetNoiseModelByName("invalid"); }); }
public void GetIdealStabilizerNoiseModelByNameWorks() { var idealStabilizer = NativeInterface.GetNoiseModelByName("ideal_stabilizer"); // TODO: Add assertions here to check properties of each noise model. }
public void GetIdealNoiseModelByNameWorks() { var ideal = NativeInterface.GetNoiseModelByName("ideal"); // TODO: Add assertions here to check properties of the above noise model. }