def test_kraus_model(): km = KrausModel('I', (5., ), (0, 1), [np.array([[1 + 1j]])], 1.0) d = km.to_dict() assert d == OrderedDict([('gate', km.gate), ('params', km.params), ('targets', (0, 1)), ('kraus_ops', [[[[1.]], [[1.0]]]]), ('fidelity', 1.0)]) assert KrausModel.from_dict(d) == km
def test_kraus_model(): km = KrausModel("I", (5.0, ), (0, 1), [np.array([[1 + 1j]])], 1.0) d = km.to_dict() assert d == OrderedDict([ ("gate", km.gate), ("params", km.params), ("targets", (0, 1)), ("kraus_ops", [[[[1.0]], [[1.0]]]]), ("fidelity", 1.0), ]) assert KrausModel.from_dict(d) == km