<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def to_dict(self):
 """ Create a dictionary representation of a KrausModel. For example:: { "gate": "RX", "params": np.pi, "targets": [0], "kraus_ops": [ # In this example single Kraus op = ideal RX(pi) gate [[[0, 0], # element-wise real part of matrix [0, 0]], [[0, -1], # element-wise imaginary part of matrix [-1, 0]]] ], "fidelity": 1.0 } :return: A JSON compatible dictionary representation. :rtype: Dict[str,Any] """

        res = self._asdict()
        res['kraus_ops'] = [[k.real.tolist(), k.imag.tolist()] for k in self.kraus_ops]
        return res