fock_state¶
Contains classes for representing in excited states of some bosonic mode. The creation/annihilation operators have a symbolic variable which can for example be the frequency of the excited state.
-
class
qualg.fock_state.
FockOp
(mode, variable, creation=True)¶ -
__init__
(mode, variable, creation=True)¶ Represents an creation/annihilation operator in a given mode with a given variable representing for example the frequency of the excitation.
- Parameters
mode (str) – The mode of the excitation
variable (str) – The variable describing the continous variable
creation (bool) – Whether this is a creation operator or not (annihilation).
-
dagger
()¶ Complex conjugate of the operator.
-
replace_var
(old_variable, new_variable)¶ Replaces a variable with another.
-
get_variables
()¶ Returns the variable of this operator.
-
-
class
qualg.fock_state.
FockOpProduct
(fock_ops=None)¶ -
__init__
(fock_ops=None)¶ A product of excitation operators (
FockOp
).- Parameters
fock_ops (list of
FockOp
) – The product of fock operators.
-
dagger
()¶ Complex conjugate of the operator.
-
variables_in_mode
(mode)¶ Get the variables in a given mode.
-
variables_by_modes
()¶ Get a dictionay of variables per modes.
-
replace_var
(old_variable, new_variable)¶ Replaces a variable with another.
-
get_variables
()¶ Returns the variable of this operator.
-
-
class
qualg.fock_state.
BaseFockState
(fock_ops=None)¶ -
__init__
(fock_ops=None)¶ A base state represented by excitations from vacuum.
- Parameters
fock_ops (
FockOpProduct
or list ofFockOp
) – The product of fock operators.
-
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`
-
replace_var
(old_variable, new_variable)¶ Replaces a variable with another.
-
get_variables
()¶ Returns the variable of this operator.
-
-
qualg.fock_state.
assert_fock_op
(op)¶ Asserts that an object is a fock operator.