Cytnx icon indicating copy to clipboard operation
Cytnx copied to clipboard

cytnx 1.0.1 or (test_version) problem

Open Heliumky opened this issue 5 months ago • 6 comments

I use the cmake to install cytnx1.0.1 package, but checking the version shows test_version.

(cytnx) jerrychen@jerrychen-X550VX:~/Desktop/Hmol/onebody/hydrogen/2d_new/r8$ python
Python 3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:45:18) [GCC 12.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cytnx
>>> print(cytnx.__version__)
test_version
>>> 

I try to use the new function named cytnx.linalg.Lanczos_Exp in the cytnx1.0.1, but after I upgraded to the test_version, I can not run my previous code smoothly( it could be run in the 0.9.7 version), it shows

  Direction: right->left
  Direction: left->right
  Energy: 12.7320791085, Trunc err: 0.00e+00+0.00e+00j
Sweep 0, chi=2, cutoff=1e-12
  Direction: right->left

# Cytnx error occur at void cytnx::linalg::iAdd(cytnx::Tensor&, const cytnx::Tensor&)
# error: [iAdd] error, the two tensor does not have the same shape. Lt rank: [3] Rt rank: [3] 

# file : /home/jerrychen/Downloads/Cytnx/src/linalg/iAdd.cpp (17)
Stack trace:
/home/jerrychen/anaconda3/envs/cytnx/lib/python3.10/site-packages/cytnx/cytnx.cpython-310-x86_64-linux-gnu.so(+0x657505) [0x7ddcdde57505]
/home/jerrychen/anaconda3/envs/cytnx/lib/python3.10/site-packages/cytnx/cytnx.cpython-310-x86_64-linux-gnu.so(_ZN5cytnx6linalg4iAddERNS_6TensorERKS1_+0x103) [0x7ddcddb3f6d3]
/home/jerrychen/anaconda3/envs/cytnx/lib/python3.10/site-packages/cytnx/cytnx.cpython-310-x86_64-linux-gnu.so(_ZN5cytnx6TensorpLIS0_EERS0_RKT_+0xa) [0x7ddcddb29c9a]
/home/jerrychen/anaconda3/envs/cytnx/lib/python3.10/site-packages/cytnx/cytnx.cpython-310-x86_64-linux-gnu.so(_ZN5cytnx14DenseUniTensor4Add_ERKN5boost13intrusive_ptrINS_14UniTensor_baseEEE+0x119) [0x7ddcddae9fa9]
/home/jerrychen/anaconda3/envs/cytnx/lib/python3.10/site-packages/cytnx/cytnx.cpython-310-x86_64-linux-gnu.so(+0x273591) [0x7ddcdda73591]
/home/jerrychen/anaconda3/envs/cytnx/lib/python3.10/site-packages/cytnx/cytnx.cpython-310-x86_64-linux-gnu.so(+0x1c0ae4) [0x7ddcdd9c0ae4]
python3(+0x1445a6) [0x5806cf63c5a6]
python3(_PyObject_MakeTpCall+0x26b) [0x5806cf635a6b]
python3(+0x150866) [0x5806cf648866]
python3(+0x1882b9) [0x5806cf6802b9]
Traceback (most recent call last):
  File "/home/jerrychen/Desktop/Hmol/onebody/sho/dynamics/run2D.py", line 85, in <module>
    psi1,ens1,terrs1 = dmrg.dmrg (1, psi1, H, L, R, maxdims, cutoff, ortho_mpss=[psi0], weights=[10])
  File "/home/jerrychen/Desktop/Hmol/onebody/sho/CytnxTools/dmrg.py", line 501, in dmrg
    enT, phi = cytnx.linalg.Lanczos(
  File "/home/jerrychen/Desktop/Hmol/onebody/sho/CytnxTools/dmrg.py", line 256, in matvec
    out += self.ortho_w[j] * overlap.item() * ortho.Dagger()
RuntimeError: 
# Cytnx error occur at void cytnx::linalg::iAdd(cytnx::Tensor&, const cytnx::Tensor&)
# error: [iAdd] error, the two tensor does not have the same shape. Lt rank: [3] Rt rank: [3] 

# file : /home/jerrychen/Downloads/Cytnx/src/linalg/iAdd.cpp (17)

Also, the strange thing that I try to install the cytnx in my conda environment but the package still used the files from the Downloads folder which is git clone folder.

Is a possible way that making the new version installation from the conda package.

Heliumky avatar Jul 16 '25 06:07 Heliumky

Version 1.0.1 on conda is broken. The problem mentioned at #595 is also not fixed in the version 1.0.1 on Conda.

IvanaGyro avatar Jul 16 '25 08:07 IvanaGyro

Also, the strange thing that I try to install the cytnx in my conda environment but the package still used the files from the Downloads folder which is git clone folder.

Could you check your sys.path? sys.path lists the paths where Python finds the modules to import by default.

IvanaGyro avatar Jul 16 '25 08:07 IvanaGyro

Is there any possible way that I can install Cytnx1.0.1 in conda as soon as possible? I mean the package can be fix in conda even #595 can not be solven. Since I always can not install the cytnx from the cmake by following the documentation, I am try to use the cytnx.linalg.Lanczos_Exp function to build up the TDVP algorithms.

Heliumky avatar Jul 17 '25 09:07 Heliumky

Is there any possible way that I can install Cytnx1.0.1 in conda as soon as possible? I mean the package can be fix in conda even #595 can not be solven. Since I always can not install the cytnx from the cmake by following the documentation, I am try to use the cytnx.linalg.Lanczos_Exp function to build up the TDVP algorithms.

I just merged a PR related to the build process. Please update your code and try

pip install . -vv \
  --config-settings skbuild.cmake.args=--preset=mkl-cuda \
  --config-settings "skbuild.cmake.args=-G Unix Makefiles"

in your conda environment. You can change the preset to what you need.

IvanaGyro avatar Jul 18 '25 06:07 IvanaGyro

Is there any possible way that I can install Cytnx1.0.1 in conda as soon as possible? I mean the package can be fix in conda even #595 can not be solven. Since I always can not install the cytnx from the cmake by following the documentation, I am try to use the cytnx.linalg.Lanczos_Exp function to build up the TDVP algorithms.

I just merged a PR related to the build process. Please update your code and try

pip install . -vv
--config-settings skbuild.cmake.args=--preset=mkl-cuda
--config-settings "skbuild.cmake.args=-G Unix Makefiles" in your conda environment. You can change the preset to what you need.

This is to confirm that this build process works on my notebook with ubuntu 24.04/gcc 13/mkl.

pcchen avatar Jul 18 '25 12:07 pcchen

@Heliumky Could you check if this is fixed in the latest commits?

yingjerkao avatar Aug 19 '25 02:08 yingjerkao