nkdsl.SymbolicOperator¶
- class SymbolicOperator(hilbert, name, ir_terms, *, dtype_str='complex64', is_hermitian=False, metadata=None)[source]¶
A symbolic operator built via the
SymbolicDiscreteJaxOperatorDSL.SymbolicOperatoris the canonical result ofSymbolicDiscreteJaxOperator(...).build(). It holds an ordered list of typed IR terms and provides a.compile()method to lower them to an executableCompiledOperator.Instances are not directly executable: calling
get_conn_paddedbefore compilation raisesSymbolicOperatorExecutionError.- Parameters:
- name¶
User-facing operator name.
- hilbert¶
The NetKet Hilbert space.
- dtype¶
Matrix-element dtype.
- is_hermitian¶
Whether this operator is declared Hermitian.
Example:
op = ( SymbolicDiscreteJaxOperator(hi, "hopping") .for_each_pair("i", "j") .where(site("i") > 0) .emit(shift("i", -1).shift("j", +1), matrix_element=1.0) .build() ) compiled = op.compile() xp, mels = compiled.get_conn_padded(x_batch)
- __init__(hilbert, name, ir_terms, *, dtype_str='complex64', is_hermitian=False, metadata=None)[source]¶
Methods
__init__(hilbert, name, ir_terms, *[, ...])apply_scalar(scalar)Returns a scaled copy of this operator.
compile(*[, backend, operator_lowering, ...])Lowers this symbolic operator to an executable
CompiledOperator.estimate_max_conn_size()Returns the aggregate static max-connection bound across all terms.
get_conn_padded(x)Raises until this operator has been compiled.
to_ir()Builds the symbolic operator IR for compiler consumption.
Attributes
Returns matrix-element dtype.
dtype_strReturns matrix-element dtype as a normalized string.
free_symbolsReturns the set of free (non-iterator-bound) symbol names across all terms.
Returns whether this operator is declared Hermitian.
max_conn_sizeReturns a static upper bound on the number of connected states.
metadataReturns operator metadata dictionary.
User-facing operator name.
operator_nameReturns user-facing operator name.
term_countNumber of IR terms in this operator.