sf.tdm.to_args_dict

to_args_dict(gate_list, device)[source]

Takes the gate arguments as a list and returns them as a dictionary.

The returned dictionary will be compatible with circuits conforming to the circuit layout in the provided device specification, and can be passed to the helper functions in the TDM utils module.

This function assumes that the loop gates are ordered in pairs of Rgate and BSgate (ignoring loop offsets and measurements), and that it begins with an Sgate:

Sgate({s}, 0.0) | 43
Rgate({r0}) | 43
BSgate({bs0}, 1.571) | [42, 43]
Rgate({loop0_phase}) | 43  # offset
Rgate({r1}) | 42
BSgate({bs1}, 1.571) | [36, 42]
Rgate({loop1_phase}) | 42  # offset
Rgate({r2}) | 36
BSgate({bs2}, 1.571) | [0, 36]
Rgate({loop2_phase}) | 36  # offset
MeasureFock() | 0
Parameters
  • gate_list (list) – list with the collected arguments for squeezing gate, phase gates and beamsplitter gates

  • device (sf.Device) – the Borealis device containing the supported squeezing parameters

Raises

ValueError – if the device specification layout doesn’t agree with the above layout, or if the passed gate arguments list contains too few entries

Returns

dictionary with the collected arguments for squeezing gate, phase gates and beamsplitter gates

Return type

dict