This module contains functions for creating HilbertSpace’s and HilbertBaseField’s. This is the preferred entry point for using the qitensor package.
Returns the HilbertBaseField for the given data type.
Parameters: | dtype (python type or Sage CommutativeRing or HilbertBaseField; default complex) – the base field data type |
---|
>>> from qitensor import base_field_lookup
>>> base_field_lookup(complex).__class__
<type 'qitensor.basefield.HilbertBaseField'>
Returns a finite-dimensional Hilbert space with an arbitrary index set.
Parameters: |
|
---|
group_op, if given, should be a class that defines an op(self, x, y) method. This supports things like the generalized pauliX operator. The default is op(self, x, y) = x*y. The qubit and qudit constructors use op(self, x, y) = (x+y)%D.
>>> from qitensor import indexed_space
>>> ha = indexed_space('a', ['x', 'y', 'z'])
>>> ha
|a>
>>> ha.indices
('x', 'y', 'z')
Returns a two-dimensional Hilbert space with index set [0, 1].
Parameters: |
|
---|
See also: qudit(), indexed_space()
>>> from qitensor import qubit
>>> ha = qubit('a')
>>> ha
|a>
>>> ha.indices
(0, 1)
Returns a finite-dimensional Hilbert space with index set [0, 1, ..., n-1].
Parameters: |
|
---|
See also: qubit(), indexed_space()
>>> from qitensor import qudit
>>> ha = qudit('a', 3)
>>> ha
|a>
>>> ha.indices
(0, 1, 2)
Returns an instance of GroupOpCyclic_impl, the cyclic group of order D.
>>> from qitensor import GroupOpCyclic_factory
>>> g = GroupOpCyclic_factory(5)
>>> g.op(2, 7)
4
Returns an instance of GroupOpTimes_impl, which operates on elements by multiplication.
>>> from qitensor import GroupOpTimes_factory
>>> g = GroupOpTimes_factory()
>>> g.op(3, 4)
12