You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm going through the CircuitToPulses class in qililab and I had some things I felt would be nice to discuss about naming conventions and some parts of the code where I'm not clear on what it is doing what it is doing. These are probably not super important things but I feel it'd be nice to agree on some things like naming conventions so that code is more readable across classes.
Non-measurement gates are called "control_gates" i feel this is ok, since they are controlling qubits after all (vs reading them). But it can also be quite confusing, specially since all gates also have gate.control_qubits; then to access control qubits for a list of control_gates one has to do "control_gate.control_qubits()"
Do we actually need to check that amplitude and duration are (int, float, np.number)? (and why here) If yes, also why here, shouldn't this be checked when gate_setttings is created (that is, at HardwareGateFactory) ?
f"Value duration: {gate_settings.duration} MUST be an integer. "
f"Current type is {type(gate_settings.duration)}."
)
From the runcard definitions I get why duration might have to be an int. However just casting a float to int without warning or anything seems dangerous. Are there any considerations for this? (eg. maybe it'd be better to round up, or even raise an error if duration is not an int)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm going through the CircuitToPulses class in qililab and I had some things I felt would be nice to discuss about naming conventions and some parts of the code where I'm not clear on what it is doing what it is doing. These are probably not super important things but I feel it'd be nice to agree on some things like naming conventions so that code is more readable across classes.
Non-measurement gates are called "control_gates" i feel this is ok, since they are controlling qubits after all (vs reading them). But it can also be quite confusing, specially since all gates also have gate.control_qubits; then to access control qubits for a list of control_gates one has to do "control_gate.control_qubits()"
qililab/src/qililab/pulse/circuit_to_pulses.py
Lines 44 to 47 in 0f634a0
Do we actually need to check that amplitude and duration are (int, float, np.number)? (and why here) If yes, also why here, shouldn't this be checked when
gate_setttings
is created (that is, atHardwareGateFactory
) ?qililab/src/qililab/pulse/circuit_to_pulses.py
Lines 107 to 132 in 0f634a0
From the runcard definitions I get why duration might have to be an int. However just casting a float to int without warning or anything seems dangerous. Are there any considerations for this? (eg. maybe it'd be better to round up, or even raise an error if duration is not an int)
qililab/src/qililab/pulse/circuit_to_pulses.py
Lines 133 to 135 in 0f634a0
(I might add more comments in the future as I see them, feel free to discuss)
Beta Was this translation helpful? Give feedback.
All reactions