q_state¶
Contains classes for qubit and qubit base states.
-
class
qualg.q_state.BaseQuditState(digits, base=2)¶ -
__init__(digits, base=2)¶ A qudit base state.
- Parameters
digits (str) – A string of the digits representing the base state, e.g “010”. Which digits in the range 0..(base-1).
(optional) (base) – How many basis states there are per position, e.g. 2 (defualt) for qubits.
-
property
shape¶ Returns the shape of the state, e.q. (2,) for a qubit.
None means that the shape is undefined, e.g. if the state is infinite-dimensional.
-
inner_product(other)¶ Takes the inner product with another
BaseState.- Parameters
other (
BaseState) – The right hand side of the inner product.- Returns
The inner product
- Return type
class`~.scalar.Scalar`
-
get_variables()¶
-
-
class
qualg.q_state.BaseQubitState(digits)¶ -
__init__(digits)¶ A qubit base state. (same as
BaseQuditStateexcept that ‘base’ is fixed to 2)- Parameters
digits (str) – A string of the digits representing the base state, e.g “010”. Which digits in the range 0..1.
-