quimb.gen.states#
Functions for generating quantum states.
Functions
|
Constructs a unit vector ket. |
|
One of the four bell-states. |
|
Construct qubit density operator from bloch vector. |
|
Generate the qubit computational state with |
|
Returns down-state, aka. |
|
Construct GHZ state of n spins, i.e. equal superposition of all up and down. |
|
Graph State on a line. |
|
Compute the generalised levi-civita coefficient for a permutation. |
|
Returns minus-state, aka. |
|
Construct Neel state for n spins, i.e. alternating up/down. |
|
Construct the anti-symmetric state which is the +- sum of all tensored permutations of states |
|
Returns plus-state, aka. |
|
Alias for the 'psi-' bell-state. |
|
Construct fully dimerised spin chain. |
|
Generate a thermal state of a Hamiltonian. |
|
Returns up-state, aka. |
|
Construct W-state: equal superposition of all single spin up states. |
|
Construct Werner State, i.e. fractional mix of identity with singlet. |
|
Returns minus-state, aka. |
|
Returns plus-state, aka. |
|
Returns yplus-state, aka. |
|
Returns yplus-state, aka. |
|
Returns down-state, aka. |
|
Returns up-state, aka. |
- quimb.gen.states.bell_state(s, **kwargs)[source]#
One of the four bell-states.
If n = 2**-0.5, they are:
'psi-'
:n * ( |01> - |10> )
'psi+'
:n * ( |01> + |10> )
'phi-'
:n * ( |00> - |11> )
'phi+'
:n * ( |00> + |11> )
They can be enumerated in this order.
- quimb.gen.states.bloch_state(ax, ay, az, purified=False, **kwargs)[source]#
Construct qubit density operator from bloch vector.
- quimb.gen.states.computational_state(binary, **kwargs)[source]#
Generate the qubit computational state with
binary
.- Parameters
binary (sequence of 0s and 1s) – The binary of the computation state.
Examples
>>> computational_state('101'): qarray([[0.+0.j], [0.+0.j], [0.+0.j], [0.+0.j], [0.+0.j], [1.+0.j], [0.+0.j], [0.+0.j]])
>>> qu.computational_state([0, 1], qtype='dop') qarray([[0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j], [0.+0.j, 1.+0.j, 0.+0.j, 0.+0.j], [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j], [0.+0.j, 0.+0.j, 0.+0.j, 0.+0.j]])
See also
MPS_computational_state
,basic_vec
- quimb.gen.states.ghz_state(n, **kwargs)[source]#
Construct GHZ state of n spins, i.e. equal superposition of all up and down.
- Parameters
n (int) – Number of spins.
kwargs – Supplied to
qu
called on state.
- Return type
vector
- quimb.gen.states.levi_civita(perm)[source]#
Compute the generalised levi-civita coefficient for a permutation.
- Parameters
perm (sequence of int) – The permutation, a re-arrangement of
range(n)
.- Returns
Either -1, 0 or 1.
- Return type
- quimb.gen.states.neel_state(n, down_first=False, **kwargs)[source]#
Construct Neel state for n spins, i.e. alternating up/down.
- Parameters
See also
computational_state
,MPS_neel_state
- quimb.gen.states.perm_state(ps)[source]#
Construct the anti-symmetric state which is the +- sum of all tensored permutations of states
ps
.- Parameters
ps (sequence of states) – The states to combine.
- Returns
The permutation state, dimension same as
kron(*ps)
.- Return type
vector or operator
Examples
A singlet is the
perm_state
of up and down.>>> states = [up(), down()] >>> pstate = perm_state(states) >>> expec(pstate, singlet()) 1.0
- quimb.gen.states.singlet_pairs(n, **kwargs)[source]#
Construct fully dimerised spin chain.
I.e.
bell_state('psi-') & bell_state('psi-') & ...
- Parameters
n (int) – Number of spins.
kwargs – Supplied to
qu
called on state.
- Return type
vector
- quimb.gen.states.thermal_state(ham, beta, precomp_func=False)[source]#
Generate a thermal state of a Hamiltonian.
- Parameters
- Returns
Density operator of thermal state, or function to generate such given a temperature.
- Return type
operator or callable
- quimb.gen.states.w_state(n, **kwargs)[source]#
Construct W-state: equal superposition of all single spin up states.
- Parameters
n (int) – Number of spins.
kwargs – Supplied to
qu
called on state.
- Return type
vector
- quimb.gen.states.werner_state(p, **kwargs)[source]#
Construct Werner State, i.e. fractional mix of identity with singlet.
- quimb.gen.states.xminus(**kwargs)#
Returns minus-state, aka.
|->
, -X eigenstate.
- quimb.gen.states.xplus(**kwargs)#
Returns plus-state, aka.
|+>
, +X eigenstate.
- quimb.gen.states.zminus(**kwargs)#
Returns down-state, aka.
|1>
, -Z eigenstate.
- quimb.gen.states.zplus(**kwargs)#
Returns up-state, aka.
|0>
, +Z eigenstate.