quairkit.operator.special

The source file of the class for the special quantum operator.

class quairkit.operator.special.ResetState

The class to reset the quantum state. It will be implemented soon.

forward(*inputs, **kwargs)

The forward function.

Returns:

NotImplemented.

class quairkit.operator.special.Collapse(system_idx, acted_system_dim, desired_result=None, if_print=False, measure_basis=None)

The class to compute the collapse of the quantum state.

Parameters:
system_idx : int | Iterable[int]

list of systems to be collapsed.

acted_system_dim : List[int]

dimension of systems that this gate acts on. Can be a list of system dimensions or an int representing the dimension of all systems. Defaults to be qubit case. Used for collapse function.

desired_result : int | str

The desired result you want to collapse. Defaults to None meaning preserving all results, and activate probabilistic computation.

if_print : bool

whether print the information about the collapsed state. Defaults to False.

measure_basis : Tensor | None

The basis of the measurement. Defaults to the computational basis.

Raises:

NotImplementedError – If the basis of measurement is not z. Other bases will be implemented in future.

property info : OperatorInfoType

Information of this channel

forward(state)

Compute the collapse of the input state.

Parameters:
state : State

The input state, which will be collapsed

Returns:

The collapsed quantum state.

Return type:

State

class quairkit.operator.special.OneWayLOCC(gate, measure_idx, measure_dim, measure_basis=None, label='M', latex_name='O')

A one-way LOCC protocol, where quantum measurement is modelled by a PVM and all channels are unitary channels.

Parameters:
gate : Gate

a Gate operator.

measure_basis : Tensor | None

basis of the measurement. Defaults to the computational basis.

label : str

name of the measured label. Defaults to 'M'.

latex_name : str

latex name of the applied operator. Defaults to 'O'.

property system_idx : list[int]

The system indices of the LOCC protocol.

property info : OperatorInfoType

Information of this channel

forward(state)

Compute the input state passing through the LOCC protocol.

Parameters:
state : State

The input state.

Returns:

The collapsed quantum state.

Return type:

State

class quairkit.operator.special.QuasiOperation(list_channels, quasi_prob, system_idx=None, type_repr='gate', acted_system_dim=2)

A quantum protocol containing quasi-operations.

Parameters:
list_channels : Tensor

a batched tensor that represents all unitaries.

quasi_prob : Tensor

the quasi-probability distribution for this quasi-operation.

system_idx : Iterable[int] | int

indices of the systems on which the protocol is applied.

type_repr : str

one of 'choi', 'kraus', 'stinespring' or 'gate'. Defaults to 'gate'.

acted_system_dim : List[int] | int

dimension of systems that these channels act on. Can be a list of system dimensions or an int representing the dimension of all systems. Defaults to be qubit case.

forward(state)

Compute the input state passing through the quasi-operation.

Parameters:
state : State

The input state.

Returns:

The collapsed quantum state.

Return type:

State