Skip to content

Commit

Permalink
Update documents
Browse files Browse the repository at this point in the history
  • Loading branch information
smorita committed Aug 22, 2023
1 parent 3376078 commit 57ec8e9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
15 changes: 12 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,18 @@ It provides similar interfaces as Numpy and Scipy in Python.

### For document generation

- Doxygen (< 1.8.12)
- Doxygen (>= 1.9.1)

## How to Use

1. Build and install mptensor library

# Modern CMake (>= 3.15)
cmake -B build
cmake --build build
sudo cmake --install build

# Traditional way
mkdir build
cd build
cmake ../
Expand All @@ -39,9 +45,12 @@ It provides similar interfaces as Numpy and Scipy in Python.

The default install directory is `/usr/local`. It can be changed by `-DCMAKE_INSTALL_PREFIX` option.

$ cmake -DCMAKE_INSTALL_PREFIX=/home/smorita/.local ../
# Modern CMake
cmake --install build --prefix your_install_prefix
# Traditional way
cmake -DCMAKE_INSTALL_PREFIX=your_install_path ../

See also the [cmake page](https://cmake.org/cmake/help/v3.6/variable/CMAKE_INSTALL_PREFIX.html).
See also the [CMake documentation](https://cmake.org/cmake/help/latest/manual/cmake.1.html).

## Documents

Expand Down
3 changes: 3 additions & 0 deletions include/mptensor/tensor.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,16 @@ class Tensor {
typedef typename Matrix<C>::comm_type comm_type; //!< type of communicator.
/*!< \c MPI_Comm or \c int. */

//! \ingroup TensorConstructor
//! \{
Tensor();
explicit Tensor(const Shape &);
explicit Tensor(const comm_type &);
Tensor(const comm_type &, const Shape &);
Tensor(const comm_type &, const Shape &, size_t upper_rank);
Tensor(const comm_type &, const Tensor<lapack::Matrix, C> &);
Tensor(const comm_type &, const std::vector<C> &);
//! \}

const Shape &shape() const;
size_t rank() const;
Expand Down
6 changes: 6 additions & 0 deletions include/mptensor/tensor_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ inline size_t Tensor<Matrix, C>::get_upper_rank() const {
};

//! Map of axes for lazy evaluation of transpose
/*!
`axes_map` stores an index mapping from a before-transposed tensor to an after-transposed tensor.
Let `V` a 3-leg tensor with `shape=[10, 20, 30]` and `axes_map=[0, 1, 2]`.
When we transpose `V` as `T = V.transpose(Axes(1, 2, 0));`, `T` has `shape=[20, 30, 10]` and `axes_map=[2, 0, 1]`. Thus, `axes_map` satisfies `axes_map[iV] = iT`.
*/
template <template <typename> class Matrix, typename C>
inline const Axes &Tensor<Matrix, C>::get_axes_map() const {
return axes_map;
Expand Down

0 comments on commit 57ec8e9

Please sign in to comment.