-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,58 @@ | ||
Qibotn is the tensor-network translation module for Qibo to support large-scale simulation of quantum circuits and acceleration. | ||
|
||
To get started, `python setup.py install` to install the tools and dependencies. | ||
|
||
# Sample Codes | ||
## Single Node | ||
|
||
<pre> | ||
``` | ||
import numpy as np | ||
from qibo import Circuit, gates | ||
import qibo | ||
|
||
''' | ||
computation_settings = { | ||
'MPI_enabled': False, | ||
'MPS_enabled': False, | ||
'NCCL_enabled': False, | ||
'expectation_enabled': { | ||
'pauli_string_pattern': "IXZ" | ||
} | ||
} | ||
''' | ||
|
||
computation_settings = { | ||
'MPI_enabled': False, | ||
'MPS_enabled': { | ||
"qr_method": False, | ||
"svd_method": { | ||
"partition": "UV", | ||
"abs_cutoff": 1e-12, | ||
}, | ||
} , | ||
'NCCL_enabled': False, | ||
'expectation_enabled': False | ||
} | ||
|
||
# computation_settings = { | ||
# 'MPI_enabled': False, | ||
# 'MPS_enabled': True, | ||
# 'NCCL_enabled': False, | ||
# 'expectation_enabled': False | ||
# } | ||
|
||
qibo.set_backend(backend="qibotn", runcard=computation_settings) | ||
|
||
# Construct the circuit | ||
c = Circuit(2) | ||
# Add some gates | ||
c.add(gates.H(0)) | ||
c.add(gates.H(1)) | ||
|
||
# Execute the circuit and obtain the final state | ||
result = c() | ||
|
||
print(result.state()) | ||
``` | ||
</pre> |