Skip to content

Commit

Permalink
docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
renatomello committed Feb 27, 2024
1 parent fddda42 commit 29f7791
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/qibo/noise.py
Original file line number Diff line number Diff line change
Expand Up @@ -438,15 +438,15 @@ def from_dict(self, parameters: dict):
all qubits share the same single-qubit depolarizing parameter.
If ``dict``, expects qubit indexes as keys and their respective
depolarizing parameter as values.
See :class:`qibo.gates.channels.DepolarizingErrorChannel`
See :class:`qibo.gates.channels.DepolarizingChannel`
for a detailed definition of depolarizing parameter.
- ``depolarizing_two_qubit`` (int or float or dict): If ``int`` or ``float``,
all two-qubit gates share the same two-qubit depolarizing parameter
regardless in which pair of qubits the two-qubit gate is acting on.
If ``dict``, expects pair qubit indexes as keys separated by a hiphen
(e.g. "0-1" for gate that has "0" as control and "1" as target)
and their respective depolarizing parameter as values.
See :class:`qibo.gates.channels.DepolarizingErrorChannel`
See :class:`qibo.gates.channels.DepolarizingChannel`
for a detailed definition of depolarizing parameter.
- ``t1`` (int or float or dict): If ``int`` or ``float``, all qubits share the
same ``t1``. If ``dict``, expects qubit indexes as keys and its
Expand All @@ -460,6 +460,17 @@ def from_dict(self, parameters: dict):
See :class:`qibo.gates.channels.ThermalRelaxationChannel`
for a detailed definition of ``t2``.
Note that ``t2`` and ``t1`` must be passed with the same type.
- ``gate_times`` (tuple or list): pair of gate times representing
gate times for :class:`ThermalRelaxationError` following, respectively,
one- and two-qubit gates.
- ``excited_population``(int or float): See :class:`ThermalRelaxationChannel`.
- ``readout_one_qubit`` (int or float or dict): If ``int`` or ``float``,
:math:`p(0|1) = p(1|0)`, and all qubits share the same readout error
probabilities. If ``dict``, expects qubit indexes as keys and
values as ``tuple`` (or ``list``) in the format :math:`(p(0|1),\\,p(1|0))`.
If values are ``tuple`` or ``list`` of length 1 or ``float`` or ``int``,
then it is assumed that :math:`p(0|1) = p(1|0)`.
"""
self.parameters = parameters
t_1 = self.parameters["t1"]
Expand Down Expand Up @@ -512,7 +523,8 @@ def from_dict(self, parameters: dict):
ThermalRelaxationError(t_1, t_2, gate_time_2, excited_population),
conditions=_ConditionQubits().condition_gate_two,
)
else:

if isinstance(t_1, dict) and isinstance(t_2, dict):
for qubit_key in t_1.keys():
self.add(
ThermalRelaxationError(
Expand Down

0 comments on commit 29f7791

Please sign in to comment.