Skip to content

Commit

Permalink
[tet.py] Remove common_toolkit to utility.
Browse files Browse the repository at this point in the history
For easy completion when searching files. Previously, `common_tensor`
and `common_toolkit` share the same prefix, which is not friendly for
searching file.
  • Loading branch information
hzhangxyz committed Aug 16, 2023
1 parent f301c95 commit 3778397
Show file tree
Hide file tree
Showing 20 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions tetragono/tetragono/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
# Miscellaneous
from . import conversion
from . import common_tensor
from . import common_toolkit
from .common_toolkit import *
from . import utility
from .utility import *

# Ansatz product state
from . import ansatz_product_state
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import numpy as np
import torch
import tetraux
from ...common_toolkit import seed_differ
from ...utility import seed_differ
from .abstract_ansatz import AbstractAnsatz


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import numpy as np
import torch
import tetraux
from ...common_toolkit import seed_differ
from ...utility import seed_differ
from .abstract_ansatz import AbstractAnsatz


Expand Down
4 changes: 2 additions & 2 deletions tetragono/tetragono/ansatz_product_state/gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import numpy as np
import TAT
from ..ansatz_product_state import AnsatzProductState, Observer, SweepSampling, ErgodicSampling
from ..common_toolkit import (show, showln, mpi_comm, mpi_rank, mpi_size, SignalHandler, seed_differ, write_to_file,
get_imported_function, restrict_wrapper, send)
from ..utility import (show, showln, mpi_comm, mpi_rank, mpi_size, SignalHandler, seed_differ, write_to_file,
get_imported_function, restrict_wrapper, send)


def check_difference(state, observer, grad, energy_observer, configuration_pool, check_difference_delta):
Expand Down
2 changes: 1 addition & 1 deletion tetragono/tetragono/ansatz_product_state/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import os
import numpy as np
from ..common_toolkit import allreduce_buffer, allreduce_iterator_buffer, mpi_rank, mpi_comm, show, showln, pickle
from ..utility import allreduce_buffer, allreduce_iterator_buffer, mpi_rank, mpi_comm, show, showln, pickle
from ..tensor_element import tensor_element
from .state import Configuration

Expand Down
2 changes: 1 addition & 1 deletion tetragono/tetragono/ansatz_product_state/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

import numpy as np
import TAT
from ..common_toolkit import mpi_rank, mpi_size
from ..utility import mpi_rank, mpi_size
from ..tensor_element import tensor_element
from .state import Configuration, AnsatzProductState

Expand Down
2 changes: 1 addition & 1 deletion tetragono/tetragono/ansatz_product_state/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from copyreg import _slotnames
from ..abstract_state import AbstractState
from ..common_toolkit import send, allreduce_iterator_buffer, bcast_iterator_buffer, showln
from ..utility import send, allreduce_iterator_buffer, bcast_iterator_buffer, showln
import tetraux


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#

import lazy
from ..common_toolkit import safe_contract, safe_rename
from ..utility import safe_contract, safe_rename


class DoubleLayerAuxiliaries:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#

import lazy
from ..common_toolkit import safe_contract, safe_rename
from ..utility import safe_contract, safe_rename


class SingleLayerAuxiliaries:
Expand Down
2 changes: 1 addition & 1 deletion tetragono/tetragono/auxiliaries/three_line_auxiliaries.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#

import lazy
from ..common_toolkit import safe_contract, safe_rename
from ..utility import safe_contract, safe_rename


class ThreeLineAuxiliaries:
Expand Down
2 changes: 1 addition & 1 deletion tetragono/tetragono/exact_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#

from copyreg import _slotnames
from .common_toolkit import show, showln
from .utility import show, showln
from .abstract_state import AbstractState


Expand Down
4 changes: 2 additions & 2 deletions tetragono/tetragono/sampling_lattice/gradient.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import numpy as np
import TAT
from ..sampling_lattice import SamplingLattice, Observer, SweepSampling, ErgodicSampling, DirectSampling
from ..common_toolkit import (show, showln, mpi_comm, mpi_rank, mpi_size, SignalHandler, seed_differ, lattice_randomize,
write_to_file, get_imported_function, restrict_wrapper)
from ..utility import (show, showln, mpi_comm, mpi_rank, mpi_size, SignalHandler, seed_differ, lattice_randomize,
write_to_file, get_imported_function, restrict_wrapper)


def check_difference(state, observer, grad, energy_observer, configuration_pool, check_difference_delta):
Expand Down
2 changes: 1 addition & 1 deletion tetragono/tetragono/sampling_lattice/lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from ..auxiliaries import SingleLayerAuxiliaries
from ..abstract_state import AbstractState
from ..abstract_lattice import AbstractLattice
from ..common_toolkit import lattice_prod_sum, lattice_conjugate, showln, bcast_lattice_buffer, safe_rename, mpi_size, mpi_rank, mpi_comm
from ..utility import lattice_prod_sum, lattice_conjugate, showln, bcast_lattice_buffer, safe_rename, mpi_size, mpi_rank, mpi_comm


class Configuration(SingleLayerAuxiliaries):
Expand Down
4 changes: 2 additions & 2 deletions tetragono/tetragono/sampling_lattice/observer.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
import os
import numpy as np
from PyScalapack import Scalapack
from ..common_toolkit import (show, showln, allreduce_lattice_buffer, allreduce_buffer, bcast_buffer, lattice_update,
lattice_prod_sum, lattice_conjugate, mpi_rank, mpi_size, mpi_comm, pickle)
from ..utility import (show, showln, allreduce_lattice_buffer, allreduce_buffer, bcast_buffer, lattice_update,
lattice_prod_sum, lattice_conjugate, mpi_rank, mpi_size, mpi_comm, pickle)
from ..tensor_element import tensor_element
from .lattice import ConfigurationPool

Expand Down
2 changes: 1 addition & 1 deletion tetragono/tetragono/sampling_lattice/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import numpy as np
import TAT
from ..auxiliaries import DoubleLayerAuxiliaries, ThreeLineAuxiliaries
from ..common_toolkit import mpi_rank, mpi_size
from ..utility import mpi_rank, mpi_size
from ..tensor_element import tensor_element
from .lattice import Configuration, SamplingLattice

Expand Down
2 changes: 1 addition & 1 deletion tetragono/tetragono/sampling_lattice/squash/horizontal.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#

import numpy as np
from ...common_toolkit import safe_rename
from ...utility import safe_rename
from ...abstract_state import AbstractState
from ...abstract_lattice import AbstractLattice
from ..lattice import SamplingLattice
Expand Down
2 changes: 1 addition & 1 deletion tetragono/tetragono/sampling_lattice/squash/vertical.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#

import numpy as np
from ...common_toolkit import safe_rename
from ...utility import safe_rename
from ...abstract_state import AbstractState
from ...abstract_lattice import AbstractLattice
from ..lattice import SamplingLattice
Expand Down
4 changes: 2 additions & 2 deletions tetragono/tetragono/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import cmd
import TAT
from io import StringIO
from .common_toolkit import (mpi_rank, mpi_size, mpi_comm, write_to_file, read_from_file, show, showln, seed_differ,
get_imported_function, seed_differ)
from .utility import (mpi_rank, mpi_size, mpi_comm, write_to_file, read_from_file, show, showln, seed_differ,
get_imported_function, seed_differ)
from . import conversion
from .exact_state import ExactState
from .simple_update_lattice import SimpleUpdateLattice
Expand Down
2 changes: 1 addition & 1 deletion tetragono/tetragono/simple_update_lattice.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import numpy as np
from .auxiliaries import DoubleLayerAuxiliaries
from .abstract_lattice import AbstractLattice
from .common_toolkit import show, showln, mpi_comm, mpi_rank, mpi_size
from .utility import show, showln, mpi_comm, mpi_rank, mpi_size


def max_parallel_size_shown(state, pool=set()):
Expand Down
File renamed without changes.

0 comments on commit 3778397

Please sign in to comment.