Conversation
docs/getting-started.rst
Outdated
|
|
||
| $ pip install -U mpqp | ||
|
|
||
| Install specific providers |
There was a problem hiding this comment.
by default, mpqp comes with nothing right ? if so, I would change this title to somethings like "add more providers" because the current phrasing sounds like by default we install everything, and the section bellow shows us how to do partial installs
There was a problem hiding this comment.
by the way, in case we install nothing by default, does this mean that by default we have no working backend ? this would be problematic
There was a problem hiding this comment.
changed to ""Add more providers": 8c9d06a. Yes by default we have no working backend. why it is problematic ?
There was a problem hiding this comment.
I think is it, it's a bit unfriendly for new user to have to think about what backend they need at install time
There was a problem hiding this comment.
maybe put in the doc mpqp[all] in first and then Install specific providers
There was a problem hiding this comment.
Or maybe mapp pip install mpqp to install it like mpqp[all], (which is the current way of working), and the user only modifies this line if he wants restricted installation, which is in my opinion not the majority of the people
| - **Qiskit**: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ pip install mpqp["qiskit"] | ||
|
|
||
| .. literalinclude:: requirements_providers/qiskit.txt | ||
| :language: text | ||
|
|
||
| - **Azure Quantum**: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ pip install mpqp["azure"] | ||
|
|
||
| .. literalinclude:: requirements_providers/azure.txt | ||
| :language: text | ||
|
|
||
| - **Amazon Braket**: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ pip install mpqp["braket"] | ||
|
|
||
| .. literalinclude:: requirements_providers/braket.txt | ||
| :language: text | ||
|
|
||
| - **myQLM**: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ pip install mpqp["myqlm"] | ||
|
|
||
| .. literalinclude:: requirements_providers/myqlm.txt | ||
| :language: text | ||
|
|
||
|
|
||
| - **Cirq**: | ||
|
|
||
| .. code-block:: console | ||
|
|
||
| $ pip install mpqp["cirq"] | ||
|
|
||
| .. literalinclude:: requirements_providers/cirq.txt | ||
| :language: text | ||
|
|
There was a problem hiding this comment.
are this soerted in any kind of order ? alphabetical, date of release, number of downloads, ...
There was a problem hiding this comment.
no, you want a specific order ?
There was a problem hiding this comment.
nb downloads maybe ? let's discuss this tomorrow
| for i in str_qiskit_circuit: | ||
| assert i in str_circuit | ||
| mpqp_qasm = QCircuit.from_other_language(str_circuit) | ||
| assert np.isclose(circuit.to_matrix(), mpqp_qasm.to_matrix()).all() |
There was a problem hiding this comment.
we don't taste the same thing anymore, either we put the old test back or we change the name of the test
There was a problem hiding this comment.
it don't test the same things but at the end it is check the custom gate validity so the name is good. And the old test just checking the str, it was breakable.
There was a problem hiding this comment.
yeah, but you test to + from in the same test I understand the reasoning, but I'm not 100% behind it
…SAS/mpqp into chore-update-provider
| src_dir = (Path(app.srcdir) / "../examples/notebooks").absolute() | ||
| dest_dir = Path(app.srcdir) / "notebooks" |
There was a problem hiding this comment.
| src_dir = (Path(app.srcdir) / "../examples/notebooks").absolute() | |
| dest_dir = Path(app.srcdir) / "notebooks" | |
| app_dir = Path(app.srcdir).absolute() | |
| src_dir = app_dir / "../examples/notebooks" | |
| dest_dir = app_dir / "notebooks" |
| src_dir = (Path(app.srcdir) / "../requirements_providers").absolute() | ||
| dest_dir = Path(app.srcdir) / "requirements_providers" |
There was a problem hiding this comment.
| src_dir = (Path(app.srcdir) / "../requirements_providers").absolute() | |
| dest_dir = Path(app.srcdir) / "requirements_providers" | |
| app_dir = Path(app.srcdir).absolute() | |
| src_dir = app_dir / "../requirements_providers" | |
| dest_dir = app_dir / "requirements_providers" |
| src_dir = (Path(app.srcdir) / "../requirements_providers").absolute() | ||
| dest_dir = Path(app.srcdir) / "requirements_providers" | ||
|
|
||
| os.makedirs(dest_dir, exist_ok=True) |
There was a problem hiding this comment.
| os.makedirs(dest_dir, exist_ok=True) | |
| dest_dir.mkdir(exist_ok=True) |
| src_dir = (Path(app.srcdir) / "../examples/notebooks").absolute() | ||
| dest_dir = Path(app.srcdir) / "notebooks" | ||
|
|
||
| os.makedirs(dest_dir, exist_ok=True) |
There was a problem hiding this comment.
| os.makedirs(dest_dir, exist_ok=True) | |
| dest_dir.mkdir(exist_ok=True) |
|
|
||
| os.makedirs(dest_dir, exist_ok=True) | ||
|
|
||
| if not os.path.exists(src_dir): |
There was a problem hiding this comment.
| if not os.path.exists(src_dir): | |
| if not src_dir.exists(): |
| if not os.path.exists(src_dir): | ||
| raise FileNotFoundError(f"Source notebooks directory not found: {src_dir}") | ||
|
|
||
| for nb in os.listdir(src_dir): |
There was a problem hiding this comment.
| for nb in os.listdir(src_dir): | |
| for nb in src_dir.iterdir(): |
|
|
||
| os.makedirs(dest_dir, exist_ok=True) | ||
|
|
||
| if not os.path.exists(src_dir): |
There was a problem hiding this comment.
| if not os.path.exists(src_dir): | |
| if not src_dir.exists(): |
| f"Source requirements_providers directory not found: {src_dir}" | ||
| ) | ||
|
|
||
| for fname in os.listdir(src_dir): |
There was a problem hiding this comment.
| for fname in os.listdir(src_dir): | |
| for fname in src_dir.iterdir(): |
| found in notebooks/. | ||
| """ | ||
| notebooks_dir = Path(app.srcdir) / "notebooks" | ||
| os.makedirs(notebooks_dir, exist_ok=True) |
There was a problem hiding this comment.
| os.makedirs(notebooks_dir, exist_ok=True) | |
| notebooks_dir.makedir(exist_ok=True) |
| os.makedirs(notebooks_dir, exist_ok=True) | ||
| output_file = notebooks_dir / "notebooks_toctree.rst" | ||
|
|
||
| notebooks = sorted(f for f in os.listdir(notebooks_dir) if f.endswith(".ipynb")) |
There was a problem hiding this comment.
| notebooks = sorted(f for f in os.listdir(notebooks_dir) if f.endswith(".ipynb")) | |
| notebooks = sorted(f for f in notebooks_dir.iterdir() if f.endswith(".ipynb")) |
|
|
||
| with open(output_file, "w", encoding="utf-8") as f: | ||
| f.write(".. toctree::\n") | ||
| f.write(" :maxdepth: 1\n") | ||
| f.write(" :caption: Notebooks:\n\n") | ||
|
|
There was a problem hiding this comment.
| with open(output_file, "w", encoding="utf-8") as f: | |
| f.write(".. toctree::\n") | |
| f.write(" :maxdepth: 1\n") | |
| f.write(" :caption: Notebooks:\n\n") | |
| prefix = """\.. toctree:: | |
| :maxdepth: 1 | |
| :caption: Notebooks: | |
| """ | |
| with open(output_file, "w", encoding="utf-8") as f: | |
| f.write(prefix) |
No description provided.