entanglish.TwoQubitState module

class entanglish.TwoQubitState.TwoQubitState[source]

Bases: object

This class has no constructor. It contains only static methods. Its methods deal with entanglement of 2 qubit states. In particular, this class implements Wootters formula for the formation entanglement of an arbitrary mixed state of 2 qubits.

static bell_key_set()[source]

This method returns a set of 4 strings which label the 4 Bell basis states.

Returns:
Return type:set[str]
static get_bell_basis_diag_dm(fid, prob_dict=None)[source]

This method returns a DenMat which is constructed as a linear combination, with coefficients prob_dict, of the Bell basis state projection operators. So the den matrix returned is diagonal in the Bell basis.

If prob_dict is not None, use it and ignore value of fid. If prob_dict is None, use prob_dict for an “isotropic” Werner state with fidelity fid. That is, prob_dict[ “==+”]=fid, prob_dict[x]=( 1-fid)/3 for all x other than ‘==+”

Parameters:
  • fid (float) – fidelity.
  • prob_dict (dict[str, float]|None) –
Returns:

Return type:

DenMat

static get_bell_basis_st_vec(key)[source]

This method returns one Bell basis state out of 4 possible ones. The 4 Bell basis states are orthonormal, maximally entangled, 2 qubit states.:

|==+> = 1/sqrt(2)[|00> + |11>]
|==-> = 1/sqrt(2)[|00> - |11>]
|!=+> = 1/sqrt(2)[|01> + |10>]
|!=-> = 1/sqrt(2)[|01> - |10>]
Parameters:key (str) – either ‘==+’, ‘==-‘, ‘!=+’, or ‘!=-‘
Returns:shape = (4,)
Return type:np.ndarray
static get_concurrence(dm)[source]

This method returns the concurrence of a DenMat dm for 2 qubits.

Parameters:dm (DenMat) –
Returns:
Return type:float
static get_known_formation_entang(dm)[source]

This method returns the known formation entanglement for a DenMat dm for 2 qubits.

Parameters:dm (DenMat) –
Returns:
Return type:float
static get_time_reversed_dm(dm)[source]

This method returns a DenMat which is the time reversed version of a DenMat dm for 2 qubits.

Parameters:dm (DenMat) –
Returns:
Return type:DenMat