entanglish.SymNupState module

class entanglish.SymNupState.SymNupState(num_up, num_qbits)[source]

Bases: object

This class is designed to perform tasks related to a SymNupState. SymNupState is an abbreviation for Symmetrized N-qubits-up State, which is a special, very convenient for testing purposes, type of quantum state vector. Note, this is a pure state of qubits only. No qudits with d != 2 in this state. The state contains a total of num_qbits qubits. num_up of them are up (in state |1>) and num_qbits - num_up are down (in state |0>). To build such a state, we first create any ( normalized) initial state vector with the required number of up and down qubits, and then we apply a total symmetrizer to that initial state vector.

It turns out that SymNupState’s have a (bipartite) entanglement that is known and has a simple analytical expression given by the classical entropy of a hyper-geometric distribution.

See Ref.1 for a more detailed explanation of the algos used in this class.

References

1. R.R. Tucci, “A New Algorithm for Calculating Squashed Entanglement and a Python Implementation Thereof”

Variables:
  • num_qbits (int) – total number of qubits in the state
  • num_up (int) – should be <= num_qbits. The number of qubits that is up (in state |1>). The other num_qbits - n_up are down (in state |0>)
__init__(num_up, num_qbits)[source]

Constructor

Parameters:
  • num_up (int) –
  • num_qbits (int) –
get_known_entang(num_x_axes)[source]

This method calculates the (bipartite) entanglement analytically, from a known formula, not numerically.

E(x_axes, y_axes)=E(y_axes, x_axes) (order of x_axes and y_axes arguments doesn’t matter)

len(x_axes)= num_x_axes, and len(y_axes)= num_row_axes - num_x_axes. After the symmetrization of the state, E(x_axes, y_axes) only depends of the numbers of x_axes and y_axes.

One can prove that E(x_axes, y_axes) is given by the hyper-geometric distribution (see Ref.1)

References

  1. https://en.wikipedia.org/wiki/Hypergeometric_distribution)
Parameters:num_x_axes (int) –
Returns:
Return type:float
get_st_vec()[source]

This method outputs the (pure) state vector for the SymNupState object.

Returns:shape=(2^self.num_qbits, )
Return type:np.ndarray