gate_lr_old

Functions

maybe_factor_gate_into_tensor(G, phys_dim, nsites, where)

manhattan_distance(coo_a, coo_b)

gate_string_split_(TG, where, string, original_ts, ...)

gate_string_reduce_split_(TG, where, string, ...)

gate_2d_long_range(self, G, where[, contract, tags, ...])

gen_long_range_path(ij_a, ij_b[, sequence])

Generate a string of coordinates, in order, from ij_a to ij_b.

gen_long_range_swap_path(ij_a, ij_b[, sequence])

Generate the coordinates or a series of swaps that would bring ij_a

swap_path_to_long_range_path(swap_path, ij_a)

Generates the ordered long-range path - a sequence of coordinates - from

get_swap(dp, dtype, backend)

Module Contents

gate_lr_old.maybe_factor_gate_into_tensor(G, phys_dim, nsites, where)
gate_lr_old.manhattan_distance(coo_a, coo_b)
gate_lr_old.gate_string_split_(TG, where, string, original_ts, bonds_along, reindex_map, site_ix, info, **compress_opts)
gate_lr_old.gate_string_reduce_split_(TG, where, string, original_ts, bonds_along, reindex_map, site_ix, info, **compress_opts)
gate_lr_old.gate_2d_long_range(self, G, where, contract=False, tags=None, inplace=False, info=None, long_range_use_swaps=False, long_range_path_sequence=None, **compress_opts)
gate_lr_old.gen_long_range_path(ij_a, ij_b, sequence=None)

Generate a string of coordinates, in order, from ij_a to ij_b.

Parameters:
  • ij_a ((int, int)) – Coordinate of site ‘a’.

  • ij_b ((int, int)) – Coordinate of site ‘b’.

  • sequence (None, iterable of {'v', 'h'}, or 'random', optional) – What order to cycle through and try and perform moves in, ‘v’, ‘h’ standing for move vertically and horizontally respectively. The default is ('v', 'h').

Returns:

The path, each element is a single coordinate.

Return type:

generator[tuple[int]]

gate_lr_old.gen_long_range_swap_path(ij_a, ij_b, sequence=None)

Generate the coordinates or a series of swaps that would bring ij_a and ij_b together.

Parameters:
  • ij_a ((int, int)) – Coordinate of site ‘a’.

  • ij_b ((int, int)) – Coordinate of site ‘b’.

  • sequence (None, it of {'av', 'bv', 'ah', 'bh'}, or 'random', optional) – What order to cycle through and try and perform moves in, ‘av’, ‘bv’, ‘ah’, ‘bh’ standing for move ‘a’ vertically, ‘b’ vertically, ‘a’ horizontally’, and ‘b’ horizontally respectively. The default is ('av', 'bv', 'ah', 'bh').

Returns:

The path, each element is two coordinates to swap.

Return type:

generator[tuple[tuple[int]]]

gate_lr_old.swap_path_to_long_range_path(swap_path, ij_a)

Generates the ordered long-range path - a sequence of coordinates - from a (long-range) swap path - a sequence of coordinate pairs.

gate_lr_old.get_swap(dp, dtype, backend)