Skip to content

Commit

Permalink
Spelling fixes (#2392)
Browse files Browse the repository at this point in the history
* Spelling fixes

* More spelling fixes

* Fix line-length lint fail due to typo fix

* A few more typos
  • Loading branch information
levbishop authored and Luciano committed May 10, 2019
1 parent d24bfd2 commit 315ba54
Show file tree
Hide file tree
Showing 61 changed files with 120 additions and 119 deletions.
2 changes: 1 addition & 1 deletion qiskit/assembler/assemble_circuits.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def assemble_circuits(circuits, run_config, qobj_id, qobj_header):
"""Assembles a list of circuits into a qobj which can be run on the backend.
Args:
circuits (list[QuantumCircuits]): circuit(s) to assemble
circuits (list[QuantumCircuit]): circuit(s) to assemble
qobj_id (int): identifier for the generated qobj
qobj_header (QobjHeader): header to pass to the results
run_config (RunConfig): configuration of the runtime environment
Expand Down
2 changes: 1 addition & 1 deletion qiskit/assembler/assemble_schedules.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def assemble_schedules(schedules, qobj_id, qobj_header, run_config):
qobj_config['pulse_library'] = [PulseLibraryItem(name=pulse.name, samples=pulse.samples)
for pulse in user_pulselib]

# create qob experiment field
# create qobj experiment field
experiments = []
schedule_los = qobj_config.pop('schedule_los', [])

Expand Down
4 changes: 2 additions & 2 deletions qiskit/assembler/disassemble.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ def _experiments_to_circuits(qobj):


def disassemble(qobj):
"""Dissasemble a qobj and return the circuits, run_config, and user header
"""Disassemble a qobj and return the circuits, run_config, and user header
Args:
qobj (Qobj): The input qobj object to dissasemble
qobj (Qobj): The input qobj object to disassemble
Returns:
circuits (list): A list of quantum circuits
run_config (dict): The dist of the run config
Expand Down
4 changes: 2 additions & 2 deletions qiskit/circuit/instruction.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
num_qubits, num_clbits: dimensions of the instruction
params: List of parameters to specialize a specific intruction instance.
params: List of parameters to specialize a specific instruction instance.
Instructions do not have any context about where they are in a circuit (which qubits/clbits).
The circuit itself keeps this context.
Expand All @@ -55,7 +55,7 @@ def __init__(self, name, num_qubits, num_clbits, params):
Args:
name (str): instruction name
num_qubits (int): instruction's qubit width
num_clbits (int): instructions's clbit width
num_clbits (int): instruction's clbit width
params (list[sympy.Basic|qasm.Node|int|float|complex|str|ndarray]): list of parameters
Raises:
QiskitError: when the register is not in the correct format.
Expand Down
2 changes: 1 addition & 1 deletion qiskit/circuit/parametertable.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals.
"""
Look-up table for varaible parameters in QuantumCircuit.
Look-up table for variable parameters in QuantumCircuit.
"""
from collections.abc import MutableMapping

Expand Down
4 changes: 2 additions & 2 deletions qiskit/dagcircuit/dagcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -529,7 +529,7 @@ def compose_back(self, input_circuit, edge_map=None):
of self.
Raises:
DAGCircuitError: if missing, duplicate or incosistent wire
DAGCircuitError: if missing, duplicate or inconsistent wire
"""
edge_map = edge_map or {}

Expand Down Expand Up @@ -815,7 +815,7 @@ def substitute_node_with_dag(self, node, input_dag, wires=None):
node = self._id_to_node[node]

condition = node.condition
# the dag must be ammended if used in a
# the dag must be amended if used in a
# conditional context. delete the op nodes and replay
# them with the condition.
if condition:
Expand Down
2 changes: 1 addition & 1 deletion qiskit/extensions/unitary.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ def __init__(self, data, label=None):
# the object to an Operator so that we can extract the underlying
# numpy matrix from `Operator.data`.
data = data.to_operator().data
# Convert to numpy array incase not already an array
# Convert to numpy array in case not already an array
data = numpy.array(data, dtype=complex)
# Check input is unitary
if not is_unitary_matrix(data):
Expand Down
2 changes: 1 addition & 1 deletion qiskit/providers/basicaer/basicaertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def _einsum_matmul_index_helper(gate_indices, number_of_qubits):
if len(gate_indices) + number_of_qubits > 26:
raise QiskitError("Total number of free indexes limited to 26")

# Indicies for N-qubit input tensor
# Indices for N-qubit input tensor
tens_in = ascii_lowercase[:number_of_qubits]

# Indices for the N-qubit output tensor
Expand Down
2 changes: 1 addition & 1 deletion qiskit/providers/basicaer/statevector_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def run(self, qobj, backend_options=None):
zero state. This size of this vector must be correct for the number
of qubits in all experiments in the qobj.
The "chop_threshold" option specifies a trunctation value for
The "chop_threshold" option specifies a truncation value for
setting small values to zero in the output statevector. The default
value is 1e-15.
Expand Down
2 changes: 1 addition & 1 deletion qiskit/providers/basicaer/unitary_simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def run(self, qobj, backend_options=None):
matrix. This size of this matrix must be correct for the number
of qubits inall experiments in the qobj.
The "chop_threshold" option specifies a trunctation value for
The "chop_threshold" option specifies a truncation value for
setting small values to zero in the output unitary. The default
value is 1e-15.
Expand Down
2 changes: 1 addition & 1 deletion qiskit/providers/models/backendconfiguration.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ class PulseBackendConfiguration(BackendConfiguration):
with form (min, max) in GHz.
dt (float): Qubit drive channel timestep in nanoseconds.
dtm (float): Measurement drive channel timestep in nanoseconds.
rep_times (list[float]): Supported repition times for device in microseconds.
rep_times (list[float]): Supported repetition times for device in microseconds.
meas_kernels (list[str]): Supported measurement kernels.
discriminators: Supported discriminators.
**kwargs: Optional fields.
Expand Down
4 changes: 2 additions & 2 deletions qiskit/pulse/pulse_lib/continuous.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def _fix_gaussian_width(gaussian_samples, amp: float, center: float, sigma: floa
ret_scale_factor: bool = False) -> np.ndarray:
r"""Enforce that the supplied gaussian pulse is zeroed at a specific width.
This is acheived by subtracting $\Omega_g(center \pm zeroed_width/2)$ from all samples.
This is achieved by subtracting $\Omega_g(center \pm zeroed_width/2)$ from all samples.
amp: Pulse amplitude at `2\times center+1`.
center: Center (mean) of pulse.
Expand Down Expand Up @@ -229,7 +229,7 @@ def drag(times: np.ndarray, amp: complex, center: float, sigma: float, beta: flo
sigma: Width (standard deviation) of pulse.
beta: Y correction amplitude. For the SNO this is $\beta=-\frac{\lambda_1^2}{4\Delta_2}$.
Where $\lambds_1$ is the relative coupling strength between the first excited and second
excited states and $\Delta_2$ is the detuning between the resepective excited states.
excited states and $\Delta_2$ is the detuning between the respective excited states.
zeroed_width: Subtract baseline to gaussian pulses to make sure
$\Omega_g(center \pm zeroed_width/2)=0$ is satisfied. This is used to avoid
large discontinuities at the start of a gaussian pulse.
Expand Down
2 changes: 1 addition & 1 deletion qiskit/pulse/pulse_lib/discrete.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def drag(duration: int, amp: complex, sigma: float, beta: float, name: str = Non
sigma: Width (standard deviation) of pulse.
beta: Y correction amplitude. For the SNO this is $\beta=-\frac{\lambda_1^2}{4\Delta_2}$.
Where $\lambds_1$ is the relative coupling strength between the first excited and second
excited states and $\Delta_2$ is the detuning between the resepective excited states.
excited states and $\Delta_2$ is the detuning between the respective excited states.
name: Name of pulse.
"""
center = duration/2
Expand Down
4 changes: 2 additions & 2 deletions qiskit/pulse/samplers/decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ def linear(times: np.ndarray, m: float, b: float) -> np.ndarray:
This in itself is not sufficient as the signature of the sampled function has
`duration`, whereas the signature of the continuous function is `time`.
This is acheived by removing `__wrapped__` set by `functools.wraps` in order to preserve
This is achieved by removing `__wrapped__` set by `functools.wraps` in order to preserve
the correct signature and also applying `_update_annotations` and `_update_docstring`
to the generated function which corrects the function annotations and adds an informative
docstring respectively.
Expand Down Expand Up @@ -209,7 +209,7 @@ def generate_sampler(continuous_pulse: Callable) -> Callable:
@functools.wraps(continuous_pulse)
def call_sampler(duration: int, *args, **kwargs) -> commands.SamplePulse:
"""Replace the call to the continuous function with a call to the sampler applied
to the anlytic pulse function."""
to the analytic pulse function."""
sampled_pulse = sample_function(continuous_pulse, duration, *args, **kwargs)
return np.asarray(sampled_pulse, dtype=np.complex_)

Expand Down
2 changes: 1 addition & 1 deletion qiskit/pulse/samplers/strategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def f(times: np.ndarray, *args, **kwargs) -> np.ndarray:
...
```
The sampler will call the `continuous_pulse` function with a set of times it will decide
according to the sampling strategy it implments along with the passed `args` and `kwargs`.
according to the sampling strategy it implements along with the passed `args` and `kwargs`.
"""

from typing import Callable
Expand Down
2 changes: 1 addition & 1 deletion qiskit/qasm/qasmparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -787,7 +787,7 @@ def p_gate_op_5e(self, program):
# | OPAQUE id gate_scope '(' ')' bit_list
# | OPAQUE id gate_scope '(' gate_id_list ')' bit_list
#
# These are like gate declarations only wihtout a body.
# These are like gate declarations only without a body.
# ----------------------------------------
def p_opaque_0(self, program):
"""
Expand Down
12 changes: 6 additions & 6 deletions qiskit/quantum_info/operators/base_operator.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ def data(self):

@property
def _atol(self):
"""The absolute tolerence parameter for float comparisons."""
"""The absolute tolerance parameter for float comparisons."""
return self.__class__.ATOL

@_atol.setter
def _atol(self, atol):
"""Set the absolute tolerence parameter for float comparisons."""
"""Set the absolute tolerance parameter for float comparisons."""
# NOTE: that this overrides the class value so applies to all
# instances of the class.
max_tol = self.__class__.MAX_TOL
Expand All @@ -86,12 +86,12 @@ def _atol(self, atol):

@property
def _rtol(self):
"""The relative tolerence parameter for float comparisons."""
"""The relative tolerance parameter for float comparisons."""
return self.__class__.RTOL

@_rtol.setter
def _rtol(self, rtol):
"""Set the relative tolerence parameter for float comparisons."""
"""Set the relative tolerance parameter for float comparisons."""
# NOTE: that this overrides the class value so applies to all
# instances of the class.
max_tol = self.__class__.MAX_TOL
Expand Down Expand Up @@ -333,7 +333,7 @@ def _einsum_matmul(cls, tensor, mat, indices, shift=0, right_mul=False):
tensor (np.array): a vector or matrix reshaped to a rank-N tensor.
mat (np.array): a matrix reshaped to a rank-2M tensor.
indices (list): tensor indices to contract with mat.
shift (int): shift for indicies of tensor to contract [Default: 0].
shift (int): shift for indices of tensor to contract [Default: 0].
right_mul (bool): if True right multiply tensor by mat
(else left multiply) [Default: False].
Expand All @@ -352,7 +352,7 @@ def _einsum_matmul(cls, tensor, mat, indices, shift=0, right_mul=False):
indices_tensor = list(range(rank))
for j, index in enumerate(indices):
indices_tensor[index + shift] = rank + j
# Get einsum indces for mat
# Get einsum indices for mat
mat_contract = list(reversed(range(rank, rank + len(indices))))
mat_free = [index + shift for index in reversed(indices)]
if right_mul:
Expand Down
2 changes: 1 addition & 1 deletion qiskit/quantum_info/operators/channel/chi.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def __init__(self, data, input_dims=None, output_dims=None):
# convert it to a SuperOp
data = SuperOp._instruction_to_superop(data)
else:
# We use the QuantumChannel init transform to intialize
# We use the QuantumChannel init transform to initialize
# other objects into a QuantumChannel or Operator object.
data = self._init_transformer(data)
input_dim, output_dim = data.dim
Expand Down
6 changes: 3 additions & 3 deletions qiskit/quantum_info/operators/channel/choi.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, data, input_dims=None, output_dims=None):
automatically determined from the input data. If the input data is
a Numpy array of shape (4**N, 4**N) qubit systems will be used. If
the input operator is not an N-qubit operator, it will assign a
single subsystem with dimension specifed by the shape of the input.
single subsystem with dimension specified by the shape of the input.
"""
# If the input is a raw list or matrix we assume that it is
# already a Choi matrix.
Expand Down Expand Up @@ -94,7 +94,7 @@ def __init__(self, data, input_dims=None, output_dims=None):
# convert it to a SuperOp
data = SuperOp._instruction_to_superop(data)
else:
# We use the QuantumChannel init transform to intialize
# We use the QuantumChannel init transform to initialize
# other objects into a QuantumChannel or Operator object.
data = self._init_transformer(data)
input_dim, output_dim = data.dim
Expand Down Expand Up @@ -124,7 +124,7 @@ def transpose(self):
# Make bipartite matrix
d_in, d_out = self.dim
data = np.reshape(self._data, (d_in, d_out, d_in, d_out))
# Swap input and output indicies on bipartite matrix
# Swap input and output indices on bipartite matrix
data = np.transpose(data, (1, 0, 3, 2))
# Transpose channel has input and output dimensions swapped
data = np.reshape(data, (d_in * d_out, d_in * d_out))
Expand Down
6 changes: 3 additions & 3 deletions qiskit/quantum_info/operators/channel/kraus.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Kraus representation of a Quantum Channel.
The Kraus representation for a quantum channel E is given by a set of matrics [A_i] such that
The Kraus representation for a quantum channel E is given by a set of matrices [A_i] such that
E(ρ) = sum_i A_i.ρ.A_i^dagger
Expand Down Expand Up @@ -66,7 +66,7 @@ def __init__(self, data, input_dims=None, output_dims=None):
automatically determined from the input data. If the input data is
a list of Numpy arrays of shape (2**N, 2**N) qubit systems will be used. If
the input does not correspond to an N-qubit channel, it will assign a
single subsystem with dimension specifed by the shape of the input.
single subsystem with dimension specified by the shape of the input.
"""
# If the input is a list or tuple we assume it is a list of Kraus
# matrices, if it is a numpy array we assume that it is a single Kraus
Expand Down Expand Up @@ -128,7 +128,7 @@ def __init__(self, data, input_dims=None, output_dims=None):
# convert it to a SuperOp
data = SuperOp._instruction_to_superop(data)
else:
# We use the QuantumChannel init transform to intialize
# We use the QuantumChannel init transform to initialize
# other objects into a QuantumChannel or Operator object.
data = self._init_transformer(data)
input_dim, output_dim = data.dim
Expand Down
2 changes: 1 addition & 1 deletion qiskit/quantum_info/operators/channel/ptm.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def __init__(self, data, input_dims=None, output_dims=None):
# convert it to a SuperOp
data = SuperOp._instruction_to_superop(data)
else:
# We use the QuantumChannel init transform to intialize
# We use the QuantumChannel init transform to initialize
# other objects into a QuantumChannel or Operator object.
data = self._init_transformer(data)
input_dim, output_dim = data.dim
Expand Down
2 changes: 1 addition & 1 deletion qiskit/quantum_info/operators/channel/quantum_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def _format_state(self, state, density_matrix=False):
if shape[1] != 1 and shape[1] != shape[0]:
raise QiskitError('Input state is not a vector or matrix.')
if shape[1] == 1:
# flatten colum-vector to vector
# flatten column-vector to vector
state = np.reshape(state, shape[0])
# Convert statevector to density matrix if required
if density_matrix and ndim == 1:
Expand Down
16 changes: 8 additions & 8 deletions qiskit/quantum_info/operators/channel/stinespring.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(self, data, input_dims=None, output_dims=None):
"""
# If the input is a list or tuple we assume it is a pair of general
# Stinespring matrices. If it is a numpy array we assume that it is
# a single stinespring matrix.
# a single Stinespring matrix.
if isinstance(data, (list, tuple, np.ndarray)):
if not isinstance(data, tuple):
# Convert single Stinespring set to length 1 tuple
Expand All @@ -81,7 +81,7 @@ def __init__(self, data, input_dims=None, output_dims=None):
np.array(data[1], dtype=complex))

dim_left, dim_right = stine[0].shape
# If two stinespring matrices check they are same shape
# If two Stinespring matrices check they are same shape
if stine[1] is not None:
if stine[1].shape != (dim_left, dim_right):
raise QiskitError("Invalid Stinespring input.")
Expand Down Expand Up @@ -354,7 +354,7 @@ def _evolve(self, state, qargs=None):
)
if state.ndim == 1 and self._data[1] is None and \
self._data[0].shape[0] // self._output_dim == 1:
# If the shape of the stinespring operator is equal to the output_dim
# If the shape of the Stinespring operator is equal to the output_dim
# evolution of a state vector psi -> stine.psi
return np.dot(self._data[0], state)
# Otherwise we always return a density matrix
Expand Down Expand Up @@ -385,7 +385,7 @@ def _tensor_product(self, other, reverse=False):
if not isinstance(other, Stinespring):
other = Stinespring(other)

# Tensor stinespring ops
# Tensor Stinespring ops
sa_l, sa_r = self._data
sb_l, sb_r = other._data

Expand All @@ -401,7 +401,7 @@ def _tensor_product(self, other, reverse=False):
shape_in = (dout_a, dtr_a, dout_b, dtr_b, din_a * din_b)
shape_out = (dout_a * dtr_a * dout_b * dtr_b, din_a * din_b)

# Compute left stinepsring op
# Compute left Stinespring op
if reverse:
input_dims = self.input_dims() + other.input_dims()
output_dims = self.output_dims() + other.output_dims()
Expand All @@ -410,12 +410,12 @@ def _tensor_product(self, other, reverse=False):
input_dims = other.input_dims() + self.input_dims()
output_dims = other.output_dims() + self.output_dims()
sab_l = np.kron(sa_l, sb_l)
# Reravel indicies
# Reravel indices
sab_l = np.reshape(
np.transpose(np.reshape(sab_l, shape_in), (0, 2, 1, 3, 4)),
shape_out)

# Compute right stinespring op
# Compute right Stinespring op
if sa_r is None and sb_r is None:
sab_r = None
else:
Expand All @@ -427,7 +427,7 @@ def _tensor_product(self, other, reverse=False):
sab_r = np.kron(sb_r, sa_r)
else:
sab_r = np.kron(sa_r, sb_r)
# Reravel indicies
# Reravel indices
sab_r = np.reshape(
np.transpose(np.reshape(sab_r, shape_in), (0, 2, 1, 3, 4)),
shape_out)
Expand Down
Loading

0 comments on commit 315ba54

Please sign in to comment.