nkdsl.SiteSelector¶
- class SiteSelector(label, namespace='site')[source]¶
Symbolic selector for one Hilbert-space site iterator.
SiteSelector is created by
site()and used inside DSL predicates, amplitude rules, and update programs. Attribute access on a selector returns symbolicAmplitudeExprnodes that are resolved by the compiler at lowering time.Methods
__init__(label[, namespace])abs()Returns
|x[i]|as an amplitude expression.as_site_ref()Returns the site-index expression used in update op site parameters.
attr(name)Returns a symbolic expression for an arbitrary site attribute.
Attributes
indexReturns symbolic expression for the integer index of this site.
labelReturns selector label.
namespaceReturns selector namespace.
valueReturns symbolic expression for the quantum number at this site.