Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions dev_tools/.pylintrc
Original file line number Diff line number Diff line change
Expand Up @@ -19,32 +19,32 @@ enable=
dangerous-default-value,
docstyle,
duplicate-argument-name,
# expression-not-assigned, # TODO: #210 - enable and fix
expression-not-assigned,
f-string-without-interpolation,
# function-redefined, # TODO: #210 - enable and fix
function-redefined,
inconsistent-mro,
init-is-generator,
# line-too-long, # TODO: #210 - enable and fix
# line-too-long, # TODO: #210 - enable and fix
lost-exception,
missing-kwoa,
# missing-param-doc, # TODO: #210 - enable and fix
missing-param-doc,
missing-raises-doc,
mixed-line-endings,
# no-value-for-parameter, # TODO: #210 - enable and fix
no-value-for-parameter,
nonexistent-operator,
not-in-loop,
# pointless-statement, # TODO: #210 - enable and fix
pointless-statement,
redefined-builtin,
return-arg-in-generator,
return-in-init,
return-outside-function,
simplifiable-if-statement,
singleton-comparison,
syntax-error,
# too-many-function-args, # TODO: #210 - enable and fix
too-many-function-args,
trailing-whitespace,
undefined-variable,
# unexpected-keyword-arg, # TODO: #210 - enable and fix
unexpected-keyword-arg,
unhashable-dict-key,
unnecessary-pass,
unreachable,
Expand Down
2 changes: 1 addition & 1 deletion dev_tools/write-ci-requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def main(
out_fn: The output filename
relative_cirq_version: Pin the desired cirq version to either "current", "previous",
or "next" version.
all_extras: Whether to include all the extras_require dependencies.
all_extras: Whether to include all the extras_require dependencies.
"""
core_reqs = _parse_requirements(REPO_DIR / "requirements.txt")
core_reqs = _set_cirq_version(core_reqs, relative_cirq_version)
Expand Down
2 changes: 1 addition & 1 deletion examples/quantum_chinese_chess/move_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def test_slide_excluded_classical_source():
)


def test_slide_excluded_classical_source():
def test_slide_excluded_quantum_source():
"""Source in quantum state."""
board = set_board(["a1", "b1", "c1"])
world = board.board
Expand Down
4 changes: 1 addition & 3 deletions examples/quantum_chinese_chess/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,4 @@ def assert_prob_about(

def assert_fifty_fifty(probabilities, that):
"""Checks that the probability of `that` is close to 50%."""
assert_prob_about(probabilities, that, 0.5), print_samples(
list(probabilities.keys())
)
assert_prob_about(probabilities, that, 0.5)
4 changes: 2 additions & 2 deletions unitary/alpha/quantum_object_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ def test_negation(simulator, compile_to_qubits):
piece, sampler=simulator(), compile_to_qubits=compile_to_qubits
)
assert board.peek() == [[0]]
-piece
-piece # pylint: disable=pointless-statement
assert board.peek() == [[1]]
-piece
-piece # pylint: disable=pointless-statement
assert board.peek() == [[0]]
piece += 1
assert board.peek() == [[1]]
Expand Down
6 changes: 5 additions & 1 deletion unitary/alpha/qudit_gates.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,11 @@ def _circuit_diagram_info_(self, args):
)

def _with_exponent(self, exponent: float) -> "QuditRzGate":
return QuditRzGate(rads=exponent * np.pi)
return QuditRzGate(
dimension=self.dimension,
radians=exponent * np.pi,
phased_state=self.phased_state,
)


class QuditPlusGate(cirq.Gate):
Expand Down
7 changes: 2 additions & 5 deletions unitary/engine_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ def run(
program_id=_get_program_id(program),
param_resolver=param_resolver,
repetitions=repetitions,
processor_ids=[self.processor_id],
gate_set=self.gate_set,
processor_id=self.processor_id,
)

def run_sweep(
Expand All @@ -127,7 +126,6 @@ def run_sweep(
program_id=_get_program_id(program),
repetitions=repetitions,
processor_ids=[self.processor_id],
gate_set=self.gate_set,
).results()

async def run_async(
Expand All @@ -139,7 +137,6 @@ async def run_async(
program_id=program_id,
repetitions=repetitions,
processor_ids=[self.processor_id],
gate_set=self.gate_set,
)
job = engine_job._refresh_job()
while True:
Expand Down Expand Up @@ -258,7 +255,7 @@ def get_sampler(self, gateset: Optional[str] = None):
@property
def device_obj(self):
dspec = self.engine.get_processor(self.processor_id).get_device_specification()
device = cg.SerializableDevice.from_proto(proto=dspec, gate_sets=[])
device = cg.SerializableDevice.from_proto(proto=dspec)
return device


Expand Down
1 change: 1 addition & 0 deletions unitary/quantum_chess/circuit_transformer.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ def map_helper(
graph: adjacency graph of connections between qubits,
representing by a dictionary from qubit to adjacent qubits.
nodes_trying: this list is used as a stack containing nodes currently under trying.
print_debug: If true, prints out debug information.

Returns:
True if mapping was successful, False if no mapping was possible.
Expand Down
1 change: 1 addition & 0 deletions unitary/quantum_chess/initial_mapping_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ def traverse(
Args:
g: A logical qubits graph.
s: The source qubit from which to start breadth-first search.
visited: helper argument to keep track of visited nodes
"""
order = deque()
if visited is None:
Expand Down