# TN
```bash
# qibotn目录下
I_MPI_FABRICS=shm:ofi \
I_MPI_OFI_PROVIDER=tcp \
FI_PROVIDER=tcp \
CASE=main1 \
OBSERVABLES=long_z_string \
NQUBITS=34 \
NLAYERS=20 \
TORCH_THREADS=48 \
SEARCH_REPEATS=2048 \
SEARCH_TIME=300 \
SCHEDULER_HOST=10.20.1.103 \
WORKER_HOSTS="10.20.1.103 10.20.1.101" \
DASK_ADDRESS="tcp://10.20.1.103:8786" \
NWORKERS=84 \
NTHREADS=1 \
MPIEXEC_FULL="mpirun -np 4 -hostfile /home/yx/qibotn/hostfile -perhost 2" \
tools/run_tn_dask_mpi_all.sh



I_MPI_FABRICS=shm:ofi \
I_MPI_OFI_PROVIDER=tcp \
FI_PROVIDER=tcp \
CASE=main1 \
OBSERVABLES=long_z_string \
NQUBITS=34 \
NLAYERS=20 \
TORCH_THREADS=48 \
SEARCH_REPEATS=2048 \
SEARCH_TIME=300 \
SCHEDULER_HOST=127.0.0.1 \
WORKER_HOSTS="127.0.0.1" \
DASK_ADDRESS="tcp://127.0.0.1:8786" \
NWORKERS=12 \
NTHREADS=1 \
MPIEXEC_FULL="mpirun -np 2 -hostfile /home/yx/qibotn/hostfile -perhost 2" \
tools/run_tn_dask_mpi_all.sh
# 单独缩并contract计算

I_MPI_FABRICS=shm:ofi \
I_MPI_OFI_PROVIDER=tcp \
FI_PROVIDER=tcp \
mpirun -np 4 -hostfile /home/yx/qibotn/hostfile -perhost 2 \
  .venv/bin/python -u tools/tn_contest_runner.py contract \
  --mpi \
  --case main1 \
  --nqubits 34 \
  --nlayers 20 \
  --observables long_z_string \
  --tree-dir trees/contest_tn \
  --torch-threads 48 \
  --dtype complex64
```

# MPS
```
cd /home/yx/qibotn

I_MPI_FABRICS=shm:ofi \
I_MPI_OFI_PROVIDER=tcp \
FI_PROVIDER=tcp \
MPIEXEC_FULL="mpirun -np 2 -hostfile /home/yx/qibotn/hostfile -perhost 2" \
TORCH_THREADS=48 \
OBS_FILTER=ring_xz \
MAIN1_NQ=128 \
MAIN1_LAYERS=24 \
MAIN1_BOND=512 \
tools/run_vidal_mpi_contest_cases.sh main1
```


 136.997

 