Skip to content

Commit 1549785

Browse files
remove default values of InternalGate (#6330)
1 parent 235a0c6 commit 1549785

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed

cirq-google/cirq_google/json_test_data/InternalGate.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"cirq_type": "InternalGate",
33
"gate_name": "CouplerDelayZ",
4-
"gate_module": "pyle.cirqtools.pyle_gates",
4+
"gate_module": "internal.module",
55
"num_qubits": 2,
66
"delay": 1,
77
"zpa": 0.0,
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
cirq_google.InternalGate(gate_name="CouplerDelayZ", gate_module="pyle.cirqtools.pyle_gates", num_qubits=2, delay=1, zpa=0.0, zpl=None)
1+
cirq_google.InternalGate(gate_name="CouplerDelayZ", gate_module="internal.module", num_qubits=2, delay=1, zpa=0.0, zpl=None)

cirq-google/cirq_google/ops/internal_gate.py

+2-8
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,12 @@ class InternalGate(ops.Gate):
2525
constructor stored in `self.gate_args`.
2626
"""
2727

28-
def __init__(
29-
self,
30-
gate_name: str,
31-
gate_module: str = 'pyle.cirqtools.pyle_gates',
32-
num_qubits: int = 1,
33-
**kwargs,
34-
):
28+
def __init__(self, gate_name: str, gate_module: str, num_qubits: int = 1, **kwargs):
3529
"""Instatiates an InternalGate.
3630
3731
Arguments:
3832
gate_name: Gate class name.
39-
gate_module: The module of the gate (defualt: pyle.cirqtools.pyle_gates).
33+
gate_module: The module of the gate.
4034
num_qubits: Number of qubits that the gate acts on.
4135
**kwargs: The named arguments to be passed to the gate constructor.
4236
"""

cirq-google/cirq_google/ops/internal_gate_test.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@
2020
def test_internal_gate():
2121
g = cirq_google.InternalGate(
2222
gate_name="CouplerDelayZ",
23-
gate_module='pyle.cirqtools.pyle_gates',
23+
gate_module='internal_module',
2424
num_qubits=2,
2525
delay=1,
2626
zpa=0.0,
2727
zpl=None,
2828
)
29-
assert str(g) == 'pyle.cirqtools.pyle_gates.CouplerDelayZ(delay=1, zpa=0.0, zpl=None)'
29+
assert str(g) == 'internal_module.CouplerDelayZ(delay=1, zpa=0.0, zpl=None)'
3030
want_repr = (
3131
"cirq_google.InternalGate(gate_name='CouplerDelayZ', "
32-
"gate_module='pyle.cirqtools.pyle_gates', num_qubits=2, "
32+
"gate_module='internal_module', num_qubits=2, "
3333
"delay=1, zpa=0.0, zpl=None)"
3434
)
3535
assert repr(g) == want_repr

0 commit comments

Comments
 (0)