Skip to content

Commit

Permalink
rebase in main and update for new rules
Browse files Browse the repository at this point in the history
  • Loading branch information
Coull committed Dec 17, 2024
1 parent da699bf commit 6b1b9c3
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/braket/aws/aws_quantum_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def metrics(
if "startedAt" in metadata:
job_start = int(metadata["startedAt"].timestamp())
if self.state() in AwsQuantumJob.TERMINAL_STATES and "endedAt" in metadata:
job_end = int(math.ceil(metadata["endedAt"].timestamp()))
job_end = math.ceil(metadata["endedAt"].timestamp())
return fetcher.get_metrics_for_job(
self.name, metric_type, statistic, job_start, job_end, self._logs_prefix
)
Expand Down
6 changes: 3 additions & 3 deletions src/braket/circuits/gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -1447,9 +1447,9 @@ def to_matrix(self) -> np.ndarray:
Returns:
np.ndarray: The matrix representation of this gate.
"""
_theta = self.angle_1
_phi = self.angle_2
_lambda = self.angle_3
_theta = self.angle_1 # noqa: RUF052
_phi = self.angle_2 # noqa: RUF052
_lambda = self.angle_3 # noqa: RUF052
return np.array([
[
np.cos(_theta / 2),
Expand Down
3 changes: 1 addition & 2 deletions src/braket/jobs/hybrid_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -416,8 +416,7 @@ def _create_job(job_args: dict[str, Any], local: bool = False) -> QuantumJob:
"tags",
"logger",
]:
if aws_only_arg in job_args:
del job_args[aws_only_arg]
job_args.pop(aws_only_arg, None)
return LocalQuantumJob.create(**job_args)
from braket.aws import AwsQuantumJob # noqa: PLC0415

Expand Down
2 changes: 1 addition & 1 deletion src/braket/pulse/ast/approximation_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ def visit_ArrayLiteral(self, node: ast.ArrayLiteral, context: _ParseState) -> li
Returns:
list[Any]: The parsed ArrayLiteral.
"""
return [self.visit(e, context) for e in node.values] # noqa: PD011
return [self.visit(e, context) for e in node.values]

def visit_IntegerLiteral(self, node: ast.IntegerLiteral, context: _ParseState) -> int:
"""Visit Integer Literal.
Expand Down
2 changes: 1 addition & 1 deletion src/braket/registers/qubit_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def __init__(self, qubits: QubitSetInput | None = None):
Qubit(2)
Qubit(3)
"""
_qubits = [Qubit.new(qubit) for qubit in _flatten(qubits)] if qubits is not None else None
_qubits = [Qubit.new(qubit) for qubit in _flatten(qubits)] if qubits is not None else None # noqa: RUF052
super().__init__(_qubits)

def map(self, mapping: dict[QubitInput, QubitInput]) -> QubitSet:
Expand Down
2 changes: 1 addition & 1 deletion src/braket/tasks/gate_model_quantum_task_result.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ def measurements_from_measurement_probabilities(
measurements_list = []
for bitstring, prob in measurement_probabilities.items():
measurement = list(bitstring)
individual_measurement_list = [measurement] * int(round(prob * shots))
individual_measurement_list = [measurement] * round(prob * shots)
measurements_list.extend(individual_measurement_list)
return np.asarray(measurements_list, dtype=int)

Expand Down

0 comments on commit 6b1b9c3

Please sign in to comment.