Skip to content

Commit

Permalink
Update sample code [skip CI]
Browse files Browse the repository at this point in the history
  • Loading branch information
Tankya2 committed Jan 31, 2024
1 parent 67fdafe commit d621eb2
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions README.md
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>

0 comments on commit d621eb2

Please sign in to comment.