quairkit.operator.special

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

class quairkit.operator.special.ResetState(system_idx, acted_system_dim, replace_state, state_label)

The class to reset the quantum state.

Parameters:
system_idx : int | Iterable[int]

list of systems to be reset.

acted_system_dim : List[int]

dimension of systems that this gate acts on.

replace_state : StateSimulator

the state to replace the quantum state.

state_label : str

LaTeX label of the reset state, used for printing.

property info : OperatorInfoType

Information of this operation

forward(state)

Perform the reset operation on the input quantum state.

Parameters:
state : StateSimulator

The input quantum state to be reset.

Returns:

The reset quantum state.

Return type:

StateSimulator

class quairkit.operator.special.Collapse(system_idx, acted_system_dim, desired_result=None, if_print=False, measure_op=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.

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_op : Tensor | None

The measurement operators of the measurement. Defaults to the computational measure.

property info : OperatorInfoType

Information of this channel

forward(state)

Compute the collapse of the input state.

Parameters:
state : StateSimulator

The input state, which will be collapsed

Returns:

The collapsed quantum state.

Return type:

StateSimulator

class quairkit.operator.special.OneWayLOCC(gate, measure_idx, measure_dim, measure_op=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 batched Gate instance.

measure_op : Tensor | None

The measurement operators of the measurement. Defaults to the computational measure.

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[list[int]]

The system indices of the LOCC protocol.

property info : OperatorInfoType

Information of this operation

forward(state)

Compute the input state passing through the LOCC protocol.

Parameters:
state : StateSimulator

The input state.

Returns:

The collapsed quantum state.

Return type:

StateSimulator

class quairkit.operator.special.QuasiOperation(channel, prob, probability_param=False)

A quantum protocol containing quasi-operations.

Parameters:
channel : Channel

a batched Channel instance. Currently, we only support the gate channel.

prob : Tensor

a 1D (quasi-)probability distribution for the channel argument.

probability_param : bool

whether the probability is parameterized. Defaults to False.

property probability : Tensor

The (quasi-)probability distribution of the quasi-operation.

property system_idx : list[int]

The system indices of the quasi-operation.

property info : OperatorInfoType

Information of this operation

forward(state)

Compute the input state passing through the quasi-operation.

Parameters:
state : StateSimulator

The input state.

Returns:

The collapsed quantum state.

Return type:

StateSimulator