Qubits

class interlinq.objects.qubit.Qubit(computing_host_id: str, q_id: str, prepare_qubit: bool = True)

Qubit object which stores the operations performed on it

classical_ctrl_gate(gate, bit_id, gate_param=None)

Operation to apply a classical control gate to the qubit

Parameters
  • gate (str) – Name of the single qubit gate to be applied

  • bit_id (str) – ID of the bit which controls if the gate should be applied

  • gate_param (list) – Parameter for rotational gates

property computing_host_id

Get the computing_host_id linked to the qubit

Returns

ID of the computing host where the qubit is located

Return type

(str)

property current_layer

Get the current_layer, which is the layer of the last operation on the qubit.

Returns

The layer number

Return type

(int)

measure(bit_id=None)

Operation to measure the qubit

Parameters

bit_id (str) – ID of the bit where the result of the measurement has to be stored

property operations

Get the operations in the layer.

Returns

List of Operation objects, which contains information about the operation to be performed on the quantum circuit

Return type

(list)

property q_id

Get the ID of the qubit :returns: ID of the qubit :rtype: (str)

rec_classical(bit_id, sender_qubit)

Operation to receive a classical bit

Parameters
  • bit_id (str) – ID of the bit which has to be sent

  • sender_qubit (Qubit) – Qubit which sends the classical bit

rec_ent(sender_id, pre_allocated=True)

Operation to receive an EPR pair

Parameters
  • sender_id (str) – ID of the computing host which sends the EPR pair

  • pre_allocated (bool) – Boolean value which determines if the qubit is pre_allocated or not

send_classical(bit_id, receiver_qubit)

Operation to send a classical bit

Parameters
  • bit_id (str) – ID of the bit which has to be sent

  • receiver_qubit (Qubit) – Qubit which receives the classical bit

send_ent(receiver_id, pre_allocated=True)

Operation to send an EPR pair

Parameters
  • receiver_id (str) – ID of the computing host which receives the EPR pair

  • pre_allocated (bool) – Boolean value which determines if the qubit is pre_allocated or not

single(gate: str, gate_param: Optional[list] = None)

Operation to apply a single gate to the qubit

Parameters
  • gate (str) – Name of the single qubit gate to be applied

  • gate_param (list) – Parameter for rotational gates

two_qubit(gate, target_qubit, gate_param=None)

Operation to apply a two qubit gate to the qubit

Parameters
  • gate (str) – Name of the single qubit gate to be applied

  • target_qubit (Qubit) – The other qubit on which the qubit gate is applied on. In case on control gates, this is the target qubit

  • gate_param (iterable) – Parameter for rotational gates

update_layer(layer: int)

Update the list of operations performed on the qubit with th

Parameters

layer (int) – Last operation performed on the qubit