Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxiLi committed Oct 22, 2021
1 parent 577889a commit dd804b7
Showing 1 changed file with 26 additions and 29 deletions.
55 changes: 26 additions & 29 deletions src/qutip_qip/device/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
class Processor(object):
"""
The noisy quantum device simulator using QuTiP dynamic solvers.
It compiles quantum circuit into a Hamiltonian model and then
It compiles quantums circuit into a Hamiltonian model and then
simulate the time-evolution described by the master equation.
Parameters
Expand All @@ -42,7 +42,7 @@ class Processor(object):
spline_kind : str, optional
Type of the coefficient interpolation. Default is "step_func"
Note that they have different requirement for the length of ``coeff``.
Note that they have different requirements for the length of ``coeff``.
-"step_func":
The coefficient will be treated as a step function.
Expand All @@ -56,14 +56,15 @@ class Processor(object):
model : :obj:`Model`
Provide a predefined physical model of the simulated hardware.
If other parameters, such as `t1` is given as input, it will overwrite those saved in :obj:`Processor.model.params`.
If other parameters, such as `t1` is given as input,
it will overwrite those saved in :obj:`Processor.model.params`.
**params:
- t1 : float or list, optional
Characterize the amplitude damping for each qubit.
A list of size `num_qubits` or a float for all qubits.
- t2 : float or list, optional
Characterize the dephasing for each qubit.
Characterize the total dephasing for each qubit.
A list of size `num_qubits` or a float for all qubits.
"""

Expand Down Expand Up @@ -109,8 +110,7 @@ def dims(self):
@property
def t1(self):
"""
Characterize the decoherence of amplitude damping of
each qubit.
Characterize the total amplitude damping of each qubit.
:type: float or list
"""
return self.params.get("t1", None)
Expand All @@ -122,8 +122,7 @@ def t1(self, value):
@property
def t2(self):
"""
Characterize the decoherence of dephasing for
each qubit.
Characterize the total dephasing for each qubit.
:type: float or list
"""
return self.params.get("t2", None)
Expand Down Expand Up @@ -195,7 +194,7 @@ def add_drift(self, qobj, targets=None, cyclic_permutation=False):
"""
Add the drift Hamiltonian to the model.
The drift Hamiltonians are intrinsic
of the quantum system and cannot be controlled by external field.
of the quantum system and cannot be controlled by an external field.
Parameters
----------
Expand Down Expand Up @@ -257,12 +256,12 @@ def add_control(

def get_control(self, label):
"""
Get the the control Hamiltonian corresponding to the label.
Get the control Hamiltonian corresponding to the label.
Parameters
----------
label :
A label that identify the Hamiltonian.
A label that identifies the Hamiltonian.
Returns
-------
Expand All @@ -278,15 +277,15 @@ def get_control_labels(self):
Returns
-------
label_list : list
A list of hashable objects each corresponds to an availbale control Hamiltonian.
A list of hashable objects each corresponds to an available control Hamiltonian.
"""
return self.model.get_control_labels()

def get_latex_str(self):
"""
Get the latex string for each Hamiltonian.
It is used in the method :meth:`.Processor.plot_pulses`.
It is a list of dictionary.
It is a list of dictionaries.
In the plot, a different color will be used
for each dictionary in the list.
Expand All @@ -312,7 +311,7 @@ def get_noise(self):
return self.model.get_noise()

def add_noise(self, noise):
"""get_noisy_pulses
"""
Add a noise object to the processor.
Parameters
Expand Down Expand Up @@ -372,12 +371,12 @@ def set_coeffs(self, coeffs):
Parameters
----------
coeffs: NumPy arraries, dict or list.
- If it is an 1-D array, all the pulses will be set
coeffs: NumPy arrays, dict or list.
- If it is a 1-D array, all the pulses will be set
by this tlist.
- If it is a dict, it should be a map of
the label of control Hamiltonians and
availablerresponding coefficients.
available responding coefficients.
Use :obj:`.Processor.get_control_labels()` to see the
available Hamiltonians.
- If it is a list of arrays or a 2D NumPy array,
Expand All @@ -401,7 +400,7 @@ def set_coeffs(self, coeffs):
)

set_all_coeffs = set_coeffs
set_all_coeffs.__doct__ = "Equivalent to :obj:`Processor.set_coeffs`."
set_all_coeffs.__doc__ = "Equivalent to :obj:`Processor.set_coeffs`."

def set_tlist(self, tlist):
"""
Expand All @@ -411,7 +410,7 @@ def set_tlist(self, tlist):
Parameters
----------
tlist: dict or list of NumPy arraries.
tlist: dict or list of NumPy arrays.
If it is a dict, it should be a map between pulse label and
the time sequences.
If it is a list of arrays or a 2D NumPy array,
Expand All @@ -428,7 +427,7 @@ def set_tlist(self, tlist):
self.pulses[pulse_dict[pulse_label]].tlist = value

set_all_tlist = set_tlist
set_all_coeffs.__doct__ = "Equivalent to :obj:`Processor.set_tlist`."
set_all_coeffs.__doc__ = "Equivalent to :obj:`Processor.set_tlist`."

def get_full_tlist(self, tol=1.0e-10):
"""
Expand Down Expand Up @@ -458,9 +457,9 @@ def get_full_coeffs(self, full_tlist=None):
Return the full coefficients in a 2d matrix form.
Each row corresponds to one pulse. If the `tlist` are
different for different pulses, the length of each row
will be same as the `full_tlist` (see method
will be the same as the `full_tlist` (see method
`get_full_tlist`). Interpolation is used for
adding the missing coefficient according to `spline_kind`.
adding the missing coefficients according to `spline_kind`.
Returns
-------
Expand Down Expand Up @@ -1152,9 +1151,8 @@ def _pulse_interpolate(pulse, tlist):

class Model:
"""
Template class for a physical model representing a quantum hardware.
The concrete model class does not have to inherit from this, as long as
the following methods are defined.
Template class for a physical model representing quantum hardware.
The concrete model class does not have to inherit from this, as long as the following methods are defined.
Parameters
----------
Expand All @@ -1172,7 +1170,6 @@ class Model:
The number of component systems.
dims : list, optional
The dimension of each component system.
Default value is a qubit system of ``dim=[2,2,2,...,2]``.
params : dict
Hardware parameters for the model.
"""
Expand All @@ -1199,12 +1196,12 @@ def get_all_drift(self) -> List[Tuple[Qobj, List[str]]]:

def get_control(self, label: Any) -> Tuple[Qobj, List[str]]:
"""
Get the the control Hamiltonian corresponding to the label.
Get the control Hamiltonian corresponding to the label.
Parameters
----------
label :
A label that identify the Hamiltonian.
A label that identifies the Hamiltonian.
Returns
-------
Expand All @@ -1225,7 +1222,7 @@ def get_control_labels(self) -> List[Any]:
-------
label_list : list
A list of hashable objects each corresponds to
an availbale control Hamiltonian.
an available control Hamiltonian.
"""
return list(self._controls.keys())

Expand Down

0 comments on commit dd804b7

Please sign in to comment.