class_docstr: Thermal relaxation error channel.
  
  This channel is modelled by the following Kraus matrices:
  
  Case :math:`T_2 \leq T_1`:
  
  .. math::
      K_0 = \sqrt{1 - p_z - p_{r0} - p_{r1}} \begin{bmatrix}
              1 & 0 \\
              0 & 1
              \end{bmatrix}
  
  .. math::
      K_1 = \sqrt{p_z}\begin{bmatrix}
              1 & 0  \\
              0 & -1
              \end{bmatrix}
  
  .. math::
      K_2 = \sqrt{p_{r0}}\begin{bmatrix}
              1 & 0  \\
              0 & 0
              \end{bmatrix}
  
  .. math::
      K_3 = \sqrt{p_{r0}}\begin{bmatrix}
              0 & 1  \\
              0 & 0
              \end{bmatrix}
  
  .. math::
      K_4 = \sqrt{p_{r1}}\begin{bmatrix}
              0 & 0  \\
              1 & 0
              \end{bmatrix}
  
  .. math::
      K_5 = \sqrt{p_{r1}}\begin{bmatrix}
              0 & 0  \\
              0 & 1
              \end{bmatrix}
  
  where :math:`p_{r0} \in [0, 1]` is the probability of a reset to 0, :math:`p_{r1} \in [0, 1]` is the probability of
  a reset to 1 error, :math:`p_z \in [0, 1]` is the probability of a phase flip (Pauli :math:`Z`) error.
  
  Case :math:`T_2 > T_1`:
  The Choi matrix is given by
  
  .. math::
      \Lambda = \begin{bmatrix}
                      1 - p_e * p_{reset} & 0 & 0 & eT_2 \\
                      0 & p_e * p_{reset} & 0 & 0 \\
                      0 & 0 & (1 - p_e) * p_{reset} & 0 \\
                      eT_2 & 0 & 0 & 1 - (1 - p_e) * p_{reset}
                      \end{bmatrix}
  
  .. math::
      K_N = \sqrt{\lambda} \Phi(\nu_{\lambda})
  
  where :math:`\lambda` are the eigenvalues of the Choi matrix, :math:`\nu_{\lambda}` are the eigenvectors of
  the choi_matrix, and :math:`\Phi(x)` is a isomorphism from :math:`\mathbb{C}^{n^2}`
  to :math:`\mathbb{C}^{n \times n}` with column-major order mapping.
  
  **Details:**
  
  * Number of wires: 1
  * Number of parameters: 4
  
  Args:
      pe (float): exited state population. Must be between ``0`` and ``1``
      t1 (float): the :math:`T_1` relaxation constant
      t2 (float): the :math:`T_2` dephasing constant. Must be less than :math:`2 T_1`
      tg (float): the gate time for relaxation error
      wires (Sequence[int] or int): the wire the channel acts on
      id (str or None): String representing the operation (optional)
class_docstr_tok: ["Thermal","relaxation","error","channel",".","This","channel","is","modelled","by","the","following","Kraus","matrices",":","Case",":","math",":","`","T_2","\\leq","T_1","`",":","..","math",":",":","K_0","=","\\sqrt","{","1","-","p_z","-","p_","{","r0","}","-","p_","{","r1","}","}","\\begin","{","bmatrix","}","1","&","0","\\\\","0","&","1","\\end","{","bmatrix","}","..","math",":",":","K_1","=","\\sqrt","{","p_z","}","\\begin","{","bmatrix","}","1","&","0","\\\\","0","&","-1","\\end","{","bmatrix","}","..","math",":",":","K_2","=","\\sqrt","{","p_","{","r0","}","}","\\begin","{","bmatrix","}","1","&","0","\\\\","0","&","0","\\end","{","bmatrix","}","..","math",":",":","K_3","=","\\sqrt","{","p_","{","r0","}","}","\\begin","{","bmatrix","}","0","&","1","\\\\","0","&","0","\\end","{","bmatrix","}","..","math",":",":","K_4","=","\\sqrt","{","p_","{","r1","}","}","\\begin","{","bmatrix","}","0","&","0","\\\\","1","&","0","\\end","{","bmatrix","}","..","math",":",":","K_5","=","\\sqrt","{","p_","{","r1","}","}","\\begin","{","bmatrix","}","0","&","0","\\\\","0","&","1","\\end","{","bmatrix","}","where",":","math",":","`","p_","{","r0","}","\\in","[","0",",","1","]","`","is","the","probability","of","a","reset","to","0",",",":","math",":","`","p_","{","r1","}","\\in","[","0",",","1","]","`","is","the","probability","of","a","reset","to","1","error",",",":","math",":","`","p_z","\\in","[","0",",","1","]","`","is","the","probability","of","a","phase","flip","(","Pauli",":","math",":","`","Z","`",")","error",".","Case",":","math",":","`","T_2",">","T_1","`",":","The","Choi","matrix","is","given","by","..","math",":",":","\\Lambda","=","\\begin","{","bmatrix","}","1","-","p_e","*","p_","{","reset","}","&","0","&","0","&","eT_2","\\\\","0","&","p_e","*","p_","{","reset","}","&","0","&","0","\\\\","0","&","0","&","(","1","-","p_e",")","*","p_","{","reset","}","&","0","\\\\","eT_2","&","0","&","0","&","1","-","(","1","-","p_e",")","*","p_","{","reset","}","\\end","{","bmatrix","}","..","math",":",":","K_N","=","\\sqrt","{","\\lambda","}","\\Phi","(","\\nu_","{","\\lambda","}",")","where",":","math",":","`","\\lambda","`","are","the","eigenvalues","of","the","Choi","matrix",",",":","math",":","`","\\nu_","{","\\lambda","}","`","are","the","eigenvectors","of","the","choi_matrix",",","and",":","math",":","`","\\Phi","(","x",")","`","is","a","isomorphism","from",":","math",":","`","\\mathbb","{","C","}","^","{","n^2","}","`","to",":","math",":","`","\\mathbb","{","C","}","^","{","n","\\times","n","}","`","with","column-major","order","mapping",".","*","*","Details",":","*","*","*","Number","of","wires",":","1","*","Number","of","parameters",":","4","Args",":","pe","(","float",")",":","exited","state","population",".","Must","be","between","``","0","``","and","``","1","``","t1","(","float",")",":","the",":","math",":","`","T_1","`","relaxation","constant","t2","(","float",")",":","the",":","math",":","`","T_2","`","dephasing","constant",".","Must","be","less","than",":","math",":","`","2","T_1","`","tg","(","float",")",":","the","gate","time","for","relaxation","error","wires","(","Sequence","[","int","]","or","int",")",":","the","wire","the","channel","acts","on","id","(","str","or","None",")",":","String","representing","the","operation","(","optional",")"]
code: def __init__(self, pe, t1, t2, tq, wires, id=None):
      super().__init__(pe, t1, t2, tq, wires=wires, id=id)
  
imports: import warnings
  import pennylane.math
  from pennylane.operation import AnyWires, Channel
label_desc: Use image node_id 1 to create a new ThermalRelaxationError object from inherited base classes: Channel with example: obj = ThermalRelaxationError(pe, t1, t2, tq, wires, id)