khive_crystal API documentation

# Package `khive_crystal`

## Sub-modules

`khive_crystal.crystal_structure`
`khive_crystal.decompositions`
`khive_crystal.fundamental_khives`
`khive_crystal.integer_hive_graph`
`khive_crystal.tensor_products`
`khive_crystal.utils`

## Functions

`def crystal_graph(khives: khive_crystal.khives.KHives) ‑> graphviz.graphs.Digraph`

  Generate the crystal graph for given KHives

  ## Args

  `khives` :`KHives`
    khives

  ## Returns

  `graphviz.Digraph`
    the crystal graph for khives
`def e(i: int) ‑> collections.abc.Callable[[khive_crystal.khive.KHive | list[khive_crystal.khive.KHive]], khive_crystal.khive.KHive | None | list[khive_crystal.khive.KHive | None]]`

  The entry point of e_i. Given H and i, return e_i(H) by appropriate crystal structure.

  ## Args

  `i` :`int`
    i in I

  ## Returns

  `Callable[[Union[KHive, List[KHive]]], int]`
    f_i

  ## Examples

      >>> H: KHive = KHive(
      ...    n=3,
      ...    alpha=[3, 2, 0],
      ...    beta=[2, 3, 0],
      ...    gamma=[0, 0, 0],
      ...    Uij=[[1, 0], [0]]
      ... )
      >>> e(i=1)(H)
      KHive(n=3, alpha=[3, 2, 0], beta=[3, 2, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])

      >>> H = KHive(
      ...     n=3,
      ...     alpha=[1, 1, 0],
      ...     beta=[1, 0, 1],
      ...     gamma=[0, 0, 0],
      ...     Uij=[[0, 0], [1]]
      ... )
      >>> e(i=2)(H)
      KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])

      >>> H: KHive = KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])
      >>> e(i=2)([H, H])

`def epsilon(i: int) ‑> collections.abc.Callable[[khive_crystal.khive.KHive | list[khive_crystal.khive.KHive]], int]`

  The entry point of epsilon_i. Given H and i, return epsilon_i(H) by appropriate crystal structure.

  ## Args

  `i` :`int`
    i in I

  ## Returns

  `Callable[[Union[KHive, List[KHive]]], int]`
    epsilon_i

  ## Examples

      >>> H: KHive = KHive(
      ...    n=3,
      ...    alpha=[3, 2, 0],
      ...    beta=[2, 3, 0],
      ...    gamma=[0, 0, 0],
      ...    Uij=[[1, 0], [0]]
      ... )
      >>> epsilon(i=1)(H)
      1

      >>> H: KHive = KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])
      >>> epsilon(i=2)(H)
      0

      >>> H: List[KHive] = [
      ...    KHive(n=3, alpha=[1, 1, 0], beta=[1, 0, 1], gamma=[0, 0, 0], Uij=[[0, 0], [1]]),
      ...    KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]]),
      ... ]
      >>> epsilon(i=2)(H)
      1

`def f(i: int) ‑> collections.abc.Callable[[khive_crystal.khive.KHive | list[khive_crystal.khive.KHive]], khive_crystal.khive.KHive | None | list[khive_crystal.khive.KHive | None]]`

  The entry point of f_i. Given H and i, return f_i(H) by appropriate crystal structure.

  ## Args

  `i` :`int`
    i in I

  ## Returns

  `Callable[[Union[KHive, List[KHive]]], int]`
    f_i

  ## Examples

      >>> H: KHive = KHive(n=3, alpha=[3, 2, 0], beta=[3, 2, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])
      >>> f(i=1)(H)
      KHive(n=3, alpha=[3, 2, 0], beta=[2, 3, 0], gamma=[0, 0, 0], Uij=[[1, 0], [0]])

      >>> H: KHive = KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])
      >>> f(i=2)(H)
      KHive(n=3, alpha=[1, 1, 0], beta=[1, 0, 1], gamma=[0, 0, 0], Uij=[[0, 0], [1]])

      >>> H: KHive = KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])
      >>> f(i=2)([H, H])
      [KHive(n=3, alpha=[1, 1, 0], beta=[1, 0, 1], gamma=[0, 0, 0], Uij=[[0, 0], [1]]), KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])]

`def khive(n: int, alpha: list[int], beta: list[int], gamma: list[int], Uij: list[list[int]]) ‑> khive_crystal.khive.KHive`

  Get a instance of KHive

  ## Args

  `n` :`int`
    size
  `alpha` :`List[int]`
    right edge labels
  `beta` :`List[int]`
    below edge labels
  `gamma` :`List[int]`
    left edge labels
  `Uij` :`List[List[int]]`
    rhombi

  ## Returns

  `KHive`
    K-hive
`def khives(n: int, alpha: list[int]) ‑> khive_crystal.khives.KHives`

  Get a instance of KHives

  ## Args

  `n` :`int`
    size
  `alpha` :`List[int]`
    right edge labels

  ## Returns

  `KHives`
    Khives
`def phi(i: int) ‑> collections.abc.Callable[[khive_crystal.khive.KHive | list[khive_crystal.khive.KHive]], int]`

  The entry point of phi_i. Given H and i, return phi_i(H) by appropriate crystal structure.

  ## Args

  `i` :`int`
    i in I

  ## Returns

  `Callable[[Union[KHive, List[KHive]]], int]`
    phi_i

  ## Examples

      >>> H: KHive = KHive(n=3, alpha=[3, 2, 0], beta=[3, 2, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])
      >>> phi(i=1)(H)
      1

      >>> H: KHive = KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])
      >>> phi(i=2)(H)
      1

      >>> H: KHive = KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])
      >>> phi(i=2)([H, H])
      2

`def psi(H: khive_crystal.khive.KHive) ‑> list[khive_crystal.khive.KHive]`

  Decompose KHive into FundamentalKHive by applying the function split repeatedly.

  ## Args

  `H` :`KHive`
    KHive

  ## Returns

  `List[KHive]`
    A pair of KHive and FundamentalKHive.

  ## Examples

      >>> H: KHive = KHive(
      ...    n=3,
      ...    alpha=[3, 3, 0],
      ...    beta=[2, 3, 1],
      ...    gamma=[0, 0, 0],
      ...    Uij=[[1, 0], [1]]
      ... )
      >>> psi(H=H)
      [KHive(n=3, alpha=[1, 1, 0], beta=[0, 1, 1], gamma=[0, 0, 0], Uij=[[1, 0], [1]]), KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]]), KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])]

      >>> H: KHive = KHive(
      ...    n=3,
      ...    alpha=[3, 1, 0],
      ...    beta=[2, 2, 0],
      ...    gamma=[0, 0, 0],
      ...    Uij=[[1, 0], [0]]
      ... )
      >>> psi(H=H)
      [KHive(n=3, alpha=[1, 0, 0], beta=[0, 1, 0], gamma=[0, 0, 0], Uij=[[1, 0], [0]]), KHive(n=3, alpha=[1, 0, 0], beta=[1, 0, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]]), KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])]

      >>> H: KHive = KHive(
      ...    n=3,
      ...    alpha=[1, 1, 0],
      ...    beta=[1, 0, 1],
      ...    gamma=[0, 0, 0],
      ...    Uij=[[0, 0], [1]]
      ... )
      >>> psi(H=H)
      [KHive(n=3, alpha=[1, 1, 0], beta=[1, 0, 1], gamma=[0, 0, 0], Uij=[[0, 0], [1]])]

`def psi_inv(H: list[khive_crystal.khive.KHive]) ‑> khive_crystal.khive.KHive`

  Compose tensor product of K-hives to a K-hive by Psi^{-1}.

  ## Args

  `H` :`List[KHive]`
    list of K-hives expected to belong to an image of Psi.

  ## Returns

  `KHive`
    Psi^{-1}(H)

  ## Examples

      >>> H1: KHive = KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])
      >>> H2: KHive = KHive(n=3, alpha=[1, 1, 0], beta=[0, 1, 1], gamma=[0, 0, 0], Uij=[[1, 0], [1]])
      >>> H: List[KHive] = [H1, H2]
      >>> psi_inv(H=H)
      KHive(n=3, alpha=[2, 2, 0], beta=[1, 2, 1], gamma=[0, 0, 0], Uij=[[1, 0], [1]])

`def psi_lambda(H: khive_crystal.khive.KHive) ‑> khive_crystal.khive.KHive | list[khive_crystal.khive.KHive]`

  Split KHive to a pair of KHive and FundamentalKHive.

  ## Args

  `H` :`KHive`
    KHive

  ## Returns

  `List[KHive]`
    A pair of KHive and FundamentalKHive.

  ## Examples

      >>> H: KHive = KHive(
      ...    n=3,
      ...    alpha=[3, 3, 0],
      ...    beta=[2, 3, 1],
      ...    gamma=[0, 0, 0],
      ...    Uij=[[1, 0], [1]]
      ... )
      >>> psi_lambda(H=H)
      [KHive(n=3, alpha=[2, 2, 0], beta=[1, 2, 1], gamma=[0, 0, 0], Uij=[[1, 0], [1]]), KHive(n=3, alpha=[1, 1, 0], beta=[1, 1, 0], gamma=[0, 0, 0], Uij=[[0, 0], [0]])]

`def view(H: khive_crystal.khive.KHive | list[khive_crystal.khive.KHive]) ‑> plotly.graph_objs._figure.Figure`

  Plot self.H to self.fig. If self.H is a KHive, plot it as origin = (0, 0). If self.H is a list of KHive, plot it as tensor products of KHive. This is a wrapper of the entry point of the class View.

  ## Args

  H (Union[KHive, List[KHive]]):

  ## Returns

  go.Figure: