parameters: (
          self,
          hilbert: AbstractHilbert,
          graph: AbstractGraph,
          h: float,
          J: float = 1.0,
          dtype: DType = float,
      )
docstring: r"""
          Constructs the Ising Operator from an hilbert space and a
          graph specifying the connectivity.
  
          Args:
              hilbert: Hilbert space the operator acts on.
              h: The strength of the transverse field.
              J: The strength of the coupling. Default is 1.0.
              dtype: The dtype of the matrix elements.
  
          Examples:
              Constructs an ``Ising`` operator for a 1D system.
  
              >>> import netket as nk
              >>> g = nk.graph.Hypercube(length=20, n_dim=1, pbc=True)
              >>> hi = nk.hilbert.Spin(s=0.5, N=g.n_nodes)
              >>> op = nk.operator.Ising(h=1.321, hilbert=hi, J=0.5, graph=g)
              >>> print(op)
              Ising(J=0.5, h=1.321; dim=20)
docstring_summary: r"""
          Constructs the Ising Operator from an hilbert space and a
          graph specifying the connectivity.
docstring_tokens: r Constructs the Ising Operator from an hilbert space and a graph specifying the connectivity .
function: def __init__(
          self,
          hilbert: AbstractHilbert,
          graph: AbstractGraph,
          h: float,
          J: float = 1.0,
          dtype: DType = float,
      ):
          r"""
          Constructs the Ising Operator from an hilbert space and a
          graph specifying the connectivity.
  
          Args:
              hilbert: Hilbert space the operator acts on.
              h: The strength of the transverse field.
              J: The strength of the coupling. Default is 1.0.
              dtype: The dtype of the matrix elements.
  
          Examples:
              Constructs an ``Ising`` operator for a 1D system.
  
              >>> import netket as nk
              >>> g = nk.graph.Hypercube(length=20, n_dim=1, pbc=True)
              >>> hi = nk.hilbert.Spin(s=0.5, N=g.n_nodes)
              >>> op = nk.operator.Ising(h=1.321, hilbert=hi, J=0.5, graph=g)
              >>> print(op)
              Ising(J=0.5, h=1.321; dim=20)
          """
          assert (
              graph.n_nodes == hilbert.size
          ), "The size of the graph must match the hilbert space"
  
          super().__init__(hilbert)
  
          self._h = dtype(h)
          self._J = dtype(J)
          self._edges = np.asarray(
              [[u, v] for u, v in graph.edges()],
              dtype=np.intp,
          )
  
          self._dtype = dtype
function_tokens: def __init__ ( self , hilbert : AbstractHilbert , graph : AbstractGraph , h : float , J : float = 1.0 , dtype : DType = float , ) : assert ( graph . n_nodes == hilbert . size ) , "The size of the graph must match the hilbert space" super ( ) . __init__ ( hilbert ) self . _h = dtype ( h ) self . _J = dtype ( J ) self . _edges = np . asarray ( [ [ u , v ] for u , v in graph . edges ( ) ] , dtype = np . intp , ) self . _dtype = dtype