Merge pull request #82 from qiboteam/fix_doc
Updating basic example in doc
This commit is contained in:
2
.github/workflows/deploy.yml
vendored
2
.github/workflows/deploy.yml
vendored
@@ -13,7 +13,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
python-version: [3.9, "3.10", "3.11", "3.12"]
|
python-version: [3.9, "3.10", "3.11", "3.12"]
|
||||||
uses: qiboteam/workflows/.github/workflows/deploy-pip-poetry.yml@main
|
uses: qiboteam/workflows/.github/workflows/deploy-pip-poetry.yml@v1
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|||||||
2
.github/workflows/publish.yml
vendored
2
.github/workflows/publish.yml
vendored
@@ -28,7 +28,7 @@ jobs:
|
|||||||
|
|
||||||
deploy-docs:
|
deploy-docs:
|
||||||
needs: [evaluate-label]
|
needs: [evaluate-label]
|
||||||
uses: qiboteam/workflows/.github/workflows/deploy-ghpages-latest-stable.yml@main
|
uses: qiboteam/workflows/.github/workflows/deploy-ghpages-latest-stable.yml@v1
|
||||||
with:
|
with:
|
||||||
python-version: "3.10"
|
python-version: "3.10"
|
||||||
package-manager: "poetry"
|
package-manager: "poetry"
|
||||||
|
|||||||
2
.github/workflows/rules.yml
vendored
2
.github/workflows/rules.yml
vendored
@@ -30,7 +30,7 @@ jobs:
|
|||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest]
|
os: [ubuntu-latest]
|
||||||
python-version: [3.9, "3.10", "3.11", "3.12"]
|
python-version: [3.9, "3.10", "3.11", "3.12"]
|
||||||
uses: qiboteam/workflows/.github/workflows/rules-poetry.yml@main
|
uses: qiboteam/workflows/.github/workflows/rules-poetry.yml@v1
|
||||||
with:
|
with:
|
||||||
os: ${{ matrix.os }}
|
os: ${{ matrix.os }}
|
||||||
python-version: ${{ matrix.python-version }}
|
python-version: ${{ matrix.python-version }}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ repos:
|
|||||||
- id: isort
|
- id: isort
|
||||||
args: ["--profile", "black"]
|
args: ["--profile", "black"]
|
||||||
- repo: https://github.com/PyCQA/docformatter
|
- repo: https://github.com/PyCQA/docformatter
|
||||||
rev: v1.7.5
|
rev: master
|
||||||
hooks:
|
hooks:
|
||||||
- id: docformatter
|
- id: docformatter
|
||||||
additional_dependencies: [tomli]
|
additional_dependencies: [tomli]
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ computation_settings = {
|
|||||||
qibo.set_backend(
|
qibo.set_backend(
|
||||||
backend="qibotn", platform="cutensornet", runcard=computation_settings
|
backend="qibotn", platform="cutensornet", runcard=computation_settings
|
||||||
) # cuQuantum
|
) # cuQuantum
|
||||||
#qibo.set_backend(backend="qibotn", platform="qutensornet", runcard=computation_settings) #quimb
|
# qibo.set_backend(backend="qibotn", platform="qutensornet", runcard=computation_settings) #quimb
|
||||||
|
|
||||||
|
|
||||||
# Construct the circuit
|
# Construct the circuit
|
||||||
|
|||||||
@@ -49,10 +49,8 @@ Basic example
|
|||||||
|
|
||||||
The following is a basic example to execute a two qubit circuit and print the final state in dense vector form using quimb backend::
|
The following is a basic example to execute a two qubit circuit and print the final state in dense vector form using quimb backend::
|
||||||
|
|
||||||
# Set the quimb backend
|
import qibo
|
||||||
qibo.set_backend(
|
from qibo import Circuit, gates
|
||||||
backend="qibotn", platform="qutensornet", runcard=computation_settings
|
|
||||||
)
|
|
||||||
|
|
||||||
# Set the runcard
|
# Set the runcard
|
||||||
computation_settings = {
|
computation_settings = {
|
||||||
@@ -62,6 +60,13 @@ The following is a basic example to execute a two qubit circuit and print the fi
|
|||||||
"expectation_enabled": False,
|
"expectation_enabled": False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
# Set the quimb backend
|
||||||
|
qibo.set_backend(
|
||||||
|
backend="qibotn", platform="qutensornet", runcard=computation_settings
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
# Construct the circuit with two qubits
|
# Construct the circuit with two qubits
|
||||||
c = Circuit(2)
|
c = Circuit(2)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user