Update readme

This commit is contained in:
tankya2
2024-02-02 12:53:48 +08:00
parent 88fb4340be
commit 347cb35442

View File

@@ -4,22 +4,22 @@ To get started, `python setup.py install` to install the tools and dependencies.
# Computation Supported # Computation Supported
- Tensornet (TN) 1. Tensornet (TN) with contractions to:
- TN contraction to dense vector - dense vector
- TN contraction to dense vector with Message Passing Interface (MPI) - expecation of given Pauli string
- TN contraction to dense vector with NCCL
- TN contraction to expectation of given Pauli string
- TN contraction to expectation of given Pauli string with Message Passing Interface (MPI)
- TN contraction to expectation of given Pauli string with NCCL
- Matrix Product State (MPS) For each TN case:
- MPS contraction to dense vector - single node
- multi node with Message Passing Interface (MPI)
- multi node with NCCL
2. Tensornet (TN) with contractions to:
- dense vector (single node)
# Sample Codes # Sample Codes
## Single Node ## Single Node
The code below shows an example of how to activate the Cuquantum TensorNetwork backend of Qibo. The code below shows an example of how to activate the Cuquantum TensorNetwork backend of Qibo.
<pre> ```py
```
import numpy as np import numpy as np
from qibo import Circuit, gates from qibo import Circuit, gates
import qibo import qibo
@@ -29,7 +29,6 @@ import qibo
# If computation_settings is not specified, the default setting is used in which all booleans will be False. # If computation_settings is not specified, the default setting is used in which all booleans will be False.
# This will trigger the dense vector computation of the tensornet. # This will trigger the dense vector computation of the tensornet.
computation_settings = {
'MPI_enabled': False, 'MPI_enabled': False,
'MPS_enabled': { 'MPS_enabled': {
"qr_method": False, "qr_method": False,
@@ -70,13 +69,11 @@ result = c()
print(result.state()) print(result.state())
``` ```
</pre>
## Multi-Node ## Multi-Node
Multi-node is enabled by setting either the MPI or NCCL enabled flag to True in the computation settings. Below shows the script to launch on 2 nodes with 2 GPUs each. $node_list contains the IP of the nodes assigned. Multi-node is enabled by setting either the MPI or NCCL enabled flag to True in the computation settings. Below shows the script to launch on 2 nodes with 2 GPUs each. $node_list contains the IP of the nodes assigned.
<pre>
``` ```sh
mpirun -n 4 -hostfile $node_list python test.py mpirun -n 4 -hostfile $node_list python test.py
``` ```
</pre>