A multi-dimension grid of points with an assigned length scale.

Used in the notebooks

Used in the tutorials

This grid acts as a helper class for parallelpiped super cells. It tracks a mapping from indices to grid points and stores the associated reciprocal lattice with respect to the original real-space lattice. This enables calculations with non-trivial unit cells.

dimensions int

Number of spatial dimensions the grid occupys

length tuple of ints

d-length tuple specifying number of points along each dimension.

shifts list of ints

Integer shifts in position to center grid.

scale ndarray

Vectors defining the super cell being simulated, vectors are stored as columns in the matrix.

volume float

Total volume of the supercell parallelpiped.

num_points int

Total number of points in the grid.

reciprocal_scale ndarray

Vectors defining the reciprocal lattice. The vectors are stored as the columns in the matrix.



View source

Returns: iterable[tuple[int]]: The index-coordinate tuple of each point in the grid.


View source

This function is the inverse of orbital_id.

qubit_id int

The tensor factor to map to grid indices.

spinless bool

Whether to use the spinless model or not.

grid_indices numpy.ndarray[int]

The location of the qubit on the grid.


View source

Args: index (tuple): d-dimensional tuple specifying index in the grid Returns: Integer momentum vector


View source

Args: momentum_ints (tuple): d-dimensional tuple momentum integers Returns: d-dimensional tuples of indices


View source

Args: momentum_ints (tuple): d-dimensional tuple momentum integers periodic (bool): Alias the momentum Returns: ndarray containing the momentum vector.


View source

Given grid point coordinate, return momentum vector with dimensions.

momentum_indices list

integers giving momentum indices. Allowed values are ints in [0, grid_length).

periodic bool

Wrap the momentum indices according to periodicity

Returns momentum_vector: A numpy array giving the momentum vector with dimensions.


View source

Return the tensor factor of a orbital with given coordinates and spin.

grid_coordinates List or tuple of ints giving coordinates of grid element. Acceptable to provide an int(instead of tuple or list) for 1D case.
spin bool

0 means spin down and 1 means spin up. If None, assume spinless model.

tensor_factor int

tensor factor associated with provided orbital label.


View source

Given grid point coordinate, return position vector with dimensions.

position_indices (int|iterable[int]): List or tuple of integers giving grid point coordinate. Allowed values are ints in [0, grid_length).

position_vector (numpy.ndarray[float])


View source

Returns: float: The volume of a length-scale hypercube within the grid.


View source

Return self==value.


View source

Return self!=value.