Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/api/qiskit/dev/_toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -2177,6 +2177,10 @@
{
"title": "qiskit.utils",
"url": "/docs/api/qiskit/dev/utils"
},
{
"title": "Root namespace",
"url": "/docs/api/qiskit/dev/root"
}
]
},
Expand Down
1 change: 1 addition & 0 deletions docs/api/qiskit/dev/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -56,5 +56,6 @@ Other:

* [Compilation Routines (`qiskit.compiler`)](compiler)
* [Top-level exceptions (`qiskit.exceptions`)](exceptions)
* [Root namespace (`qiskit`)](root)
* [Utilities (`qiskit.utils`)](utils)

2 changes: 1 addition & 1 deletion docs/api/qiskit/dev/qiskit.circuit.library.MCPhaseGate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ python_api_name: qiskit.circuit.library.MCPhaseGate

* **num\_ctrl\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of controls to add. Defauls to `1`.
* **label** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) – Optional gate label. Defaults to `None`.
* **ctrl\_state** ([*int*](https://docs.python.org/3/library/functions.html#int) *|*[*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) – The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`
* **ctrl\_state** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *|*[*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`
* **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool) *| None*) – Ignored.

**Returns**
Expand Down
2 changes: 1 addition & 1 deletion docs/api/qiskit/dev/qiskit.circuit.library.MCXGate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ python_api_name: qiskit.circuit.library.MCXGate

* **num\_ctrl\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of controls to add. Defauls to `1`.
* **label** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) – Optional gate label. Defaults to `None`.
* **ctrl\_state** ([*int*](https://docs.python.org/3/library/functions.html#int) *|*[*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) – The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`
* **ctrl\_state** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *|*[*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`
* **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool) *| None*) – Ignored.

**Returns**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ $$

* **num\_ctrl\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of controls to add. Defauls to `1`.
* **label** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) – A label for the resulting Pauli evolution gate, to display in visualizations. Per default, the label is set to `exp(-it <operators>)` where `<operators>` is the sum of the Paulis. Note that the label does not include any coefficients of the Paulis. See the class docstring for an example.
* **ctrl\_state** ([*int*](https://docs.python.org/3/library/functions.html#int) *|*[*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) – The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`.
* **ctrl\_state** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *|*[*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`.
* **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool) *| None*) – Ignored.

**Returns**
Expand Down
2 changes: 1 addition & 1 deletion docs/api/qiskit/dev/qiskit.circuit.library.PhaseGate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ $$

* **num\_ctrl\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of controls to add. Defauls to `1`.
* **label** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) – Optional gate label. Defaults to `None`.
* **ctrl\_state** ([*int*](https://docs.python.org/3/library/functions.html#int) *|*[*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) – The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`
* **ctrl\_state** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *|*[*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`
* **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool) *| None*) – Ignored.

**Returns**
Expand Down
2 changes: 1 addition & 1 deletion docs/api/qiskit/dev/qiskit.circuit.library.XGate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ $$

* **num\_ctrl\_qubits** ([*int*](https://docs.python.org/3/library/functions.html#int)) – Number of controls to add. Defauls to `1`.
* **label** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) – Optional gate label. Defaults to `None`.
* **ctrl\_state** ([*str*](https://docs.python.org/3/library/stdtypes.html#str) *|*[*int*](https://docs.python.org/3/library/functions.html#int) *| None*) – The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`
* **ctrl\_state** ([*int*](https://docs.python.org/3/library/functions.html#int) *|*[*str*](https://docs.python.org/3/library/stdtypes.html#str) *| None*) – The control state of the gate, specified either as an integer or a bitstring (e.g. `"110"`). If `None`, defaults to the all-ones state `2**num_ctrl_qubits - 1`
* **annotated** ([*bool*](https://docs.python.org/3/library/functions.html#bool) *| None*) – Ignored.

**Returns**
Expand Down
16 changes: 16 additions & 0 deletions docs/api/qiskit/dev/qiskit.quantum_info.PauliLindbladMap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,22 @@ $$
Calculate the $\gamma$ for the map.
</Function>

### generators

<Function id="qiskit.quantum_info.PauliLindbladMap.generators" signature="generators()">
Get the generators of the map.

This is an alias for [`get_qubit_sparse_pauli_list_copy()`](#qiskit.quantum_info.PauliLindbladMap.get_qubit_sparse_pauli_list_copy "qiskit.quantum_info.PauliLindbladMap.get_qubit_sparse_pauli_list_copy"), providing a more convenient name that aligns with the naming conventions used in Aer and Runtime for similar classes.

**Returns**

A copy of the map’s generator terms.

**Return type**

[QubitSparsePauliList](qiskit.quantum_info.QubitSparsePauliList "qiskit.quantum_info.QubitSparsePauliList")
</Function>

### get\_qubit\_sparse\_pauli\_list\_copy

<Function id="qiskit.quantum_info.PauliLindbladMap.get_qubit_sparse_pauli_list_copy" signature="get_qubit_sparse_pauli_list_copy()">
Expand Down
43 changes: 43 additions & 0 deletions docs/api/qiskit/dev/root.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
---
title: Qiskit SDK API documentation (dev version)
description: Re-exports in the root namespace in the dev version of qiskit.
---

<span id="root-namespace-qiskit" />

<span id="qiskit-root" />

# Root namespace ([`qiskit`](index#module-qiskit "qiskit"))

Most Qiskit functionality is accessed through specific submodules. You can consult the top-level documentation of [`qiskit`](index#module-qiskit "qiskit") to find the list of modules, such as [`qiskit.circuit`](circuit#module-qiskit.circuit "qiskit.circuit") or [`qiskit.transpiler.passes`](transpiler_passes#module-qiskit.transpiler.passes "qiskit.transpiler.passes").

Several names are re-exported from the repository root, whose canonical public locations are in submodules. The re-exports in the root namespace are part of Qiskit’s public API.

Names re-exported from [`qiskit.circuit`](circuit#module-qiskit.circuit "qiskit.circuit"):

| | |
| ----------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------ |
| [`AncillaRegister`](circuit#qiskit.circuit.AncillaRegister "qiskit.circuit.AncillaRegister")(\[size, name, bits]) | Implement an ancilla register. |
| [`ClassicalRegister`](circuit#qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister")(\[size, name, bits]) | Implement a register. |
| [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit")(\*regs\[, name, global\_phase, ...]) | Core Qiskit representation of a quantum circuit. |
| [`QuantumRegister`](circuit#qiskit.circuit.QuantumRegister "qiskit.circuit.QuantumRegister")(\[size, name, bits]) | Implement a register. |

Names re-exported from [`qiskit.compiler`](compiler#module-qiskit.compiler "qiskit.compiler"):

| | |
| ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| [`transpile`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile")(circuits\[, backend, basis\_gates, ...]) | Transpile one or more circuits, according to some desired transpilation targets. |

Names re-exported from [`qiskit.exceptions`](exceptions#module-qiskit.exceptions "qiskit.exceptions"):

| | |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------- |
| [`MissingOptionalLibraryError`](exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError")(libname, name\[, ...]) | Raised when an optional library is missing. |
| [`QiskitError`](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError")(\*message) | Base class for errors raised by Qiskit. |

Names re-exported from [`qiskit.transpiler`](transpiler#module-qiskit.transpiler "qiskit.transpiler"):

| | |
| ----------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------ |
| [`generate_preset_pass_manager`](qiskit.transpiler.generate_preset_pass_manager "qiskit.transpiler.generate_preset_pass_manager")(\[...]) | Generate a preset [`PassManager`](qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") |

Binary file modified public/docs/api/qiskit/dev/objects.inv
Binary file not shown.
Binary file modified public/docs/images/api/qiskit-ibm-runtime/dev/fake_provider-2.avif
Binary file not shown.
Binary file modified public/docs/images/api/qiskit-ibm-runtime/dev/fake_provider-3.avif
Binary file not shown.
Binary file not shown.
Binary file modified public/docs/images/api/qiskit/dev/circuit_random-1.avif
Binary file not shown.
Binary file modified public/docs/images/api/qiskit/dev/circuit_random-3.avif
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified public/docs/images/api/qiskit/dev/transpiler-10.avif
Binary file not shown.
Binary file modified public/docs/images/api/qiskit/dev/transpiler-9.avif
Binary file not shown.
Binary file modified public/docs/images/api/qiskit/dev/visualization-1.avif
Binary file not shown.
Binary file modified public/docs/images/api/qiskit/dev/visualization-3.avif
Binary file not shown.
4 changes: 2 additions & 2 deletions scripts/config/api-html-artifacts.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"qiskit": {
"dev": "https://api.github.com/repos/Qiskit/qiskit/actions/artifacts/5218013247/zip",
"dev": "https://api.github.com/repos/Qiskit/qiskit/actions/artifacts/5285603325/zip",
"2.3": "https://ibm.box.com/shared/static/hu6gvj4857vb5sew5k98rr9yd7pxasqy.zip",
"2.2": "https://ibm.box.com/shared/static/c1lktwwwo9zu4z5wxqg1xs9fj57oeoco.zip",
"2.1": "https://ibm.box.com/shared/static/mplc0lvu7mi2xwri9z3y0u0lr6z9ivwv.zip",
Expand Down Expand Up @@ -35,7 +35,7 @@
"0.19": "https://ibm.box.com/shared/static/wjoea4x5tnxd0l4lgo2v3kxnx6btxvvl.zip"
},
"qiskit-ibm-runtime": {
"dev": "https://api.github.com/repos/Qiskit/qiskit-ibm-runtime/actions/artifacts/5208052291/zip",
"dev": "https://api.github.com/repos/Qiskit/qiskit-ibm-runtime/actions/artifacts/5230621787/zip",
"0.45": "https://ibm.box.com/shared/static/5o5rt86cc2ehvxmslleecat3iyob8igu.zip",
"0.44": "https://ibm.box.com/shared/static/o00e7wxcslox4vq3z0rz35093y40sfko.zip",
"0.43": "https://ibm.box.com/shared/static/nlpyvweh4n0xhuvl08p8zpykkkchgi2a.zip",
Expand Down
3 changes: 2 additions & 1 deletion scripts/config/historical-pages-to-latest.json
Original file line number Diff line number Diff line change
Expand Up @@ -1125,7 +1125,8 @@
"qiskit.primitives.ObservableLike": "/",
"qiskit.primitives.ObservablesArray": "/",
"qiskit.primitives.ParameterLike": "/",
"qiskit.primitives.SamplerPub": "/"
"qiskit.primitives.SamplerPub": "/",
"root": "/"
}
},
"qiskit-ibm-runtime": {
Expand Down
2 changes: 1 addition & 1 deletion scripts/js/lib/api/Metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// copyright notice, and modified files need to carry a notice indicating
// that they have been altered from the originals.

export type ApiTypeName = ApiObjectName | "module";
export type ApiTypeName = ApiObjectName | "module" | "syntheticModule";
export type ApiObjectName =
// Python API types
| "class"
Expand Down
4 changes: 4 additions & 0 deletions scripts/js/lib/api/Pkg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export class Pkg {
/// Convert URLs like `my_pkg.SomeClass` to `some-class` for better SEO.
readonly kebabCaseAndShortenUrls: boolean;
readonly artifactPackageName: string;
readonly hasRootNamespaceFile: boolean;

static VALID_NAMES = [
"qiskit",
Expand All @@ -81,6 +82,7 @@ export class Pkg {
tocGrouping?: TocGrouping;
kebabCaseAndShortenUrls: boolean;
artifactPackageName?: string;
hasRootNamespaceFile?: boolean;
}) {
this.name = kwargs.name;
this.title = kwargs.title;
Expand All @@ -94,6 +96,7 @@ export class Pkg {
this.tocGrouping = kwargs.tocGrouping;
this.kebabCaseAndShortenUrls = kwargs.kebabCaseAndShortenUrls;
this.artifactPackageName = kwargs.artifactPackageName ?? this.name;
this.hasRootNamespaceFile = kwargs.hasRootNamespaceFile ?? false;
}

static async fromArgs(
Expand Down Expand Up @@ -126,6 +129,7 @@ export class Pkg {
tocGrouping: QISKIT_TOC_GROUPING,
kebabCaseAndShortenUrls: false,
language: "Python",
hasRootNamespaceFile: true,
});
}

Expand Down
9 changes: 9 additions & 0 deletions scripts/js/lib/api/TocGrouping.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,15 @@ async function getIndexModuleGroups(fp: string): Promise<ModuleGroup[]> {
const isDedicatedClassPage = line.includes(" class](");
if (isDedicatedClassPage) continue;

// Certain packages like Qiskit 2.4+ have a manually created root page.
// That page shows up in index.mdx as a top-level entry, but it is not
// a top-level entry in the left ToC. This is expected, so, we allow
// the index to diverge from the left ToC.
//
// This is looking for e.g. '[Root namespace (`qiskit`)](root)'
const isRootPage = line.includes("](root)");
if (isRootPage) continue;

const module = extractModuleName(line);
currentGroup.push(module);
}
Expand Down
1 change: 1 addition & 0 deletions scripts/js/lib/api/TocGrouping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ function qiskitModuleToSection(module: string): string | undefined {
"qiskit.qobj",
"qiskit.tools",
"qiskit.utils",
"Root namespace",
])
) {
return _OTHER;
Expand Down
8 changes: 8 additions & 0 deletions scripts/js/lib/api/addFrontMatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ title: ${removeSuffix(pkg.title, " API")} API documentation (${titleVersion})
description: Index of all the modules ${descriptionVersion}.
---

${markdown}
`;
} else if (result.url.endsWith("/root") && pkg.hasRootNamespaceFile) {
result.markdown = `---
title: ${removeSuffix(pkg.title, " API")} API documentation (${titleVersion})
description: Re-exports in the root namespace ${descriptionVersion}.
---

${markdown}
`;
} else if (result.meta.apiName) {
Expand Down
1 change: 1 addition & 0 deletions scripts/js/lib/api/conversionPipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ async function convertFilesToMarkdown(
releaseNotesTitle: pkg.releaseNotesTitle(),
hasSeparateReleaseNotes: pkg.hasSeparateReleaseNotes(),
isCApi: pkg.isCApi(),
hasRootNamespaceFile: pkg.hasRootNamespaceFile,
});

// Avoid creating an empty markdown file for HTML files without content
Expand Down
6 changes: 5 additions & 1 deletion scripts/js/lib/api/generateToc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,11 @@ function getModulesAndItems(
// However, C does not have modules.
const modules = options.isCApi
? resultsWithName
: resultsWithName.filter((result) => result.meta.apiType === "module");
: resultsWithName.filter(
(result) =>
result.meta.apiType === "module" ||
result.meta.apiType === "syntheticModule",
);
const items = resultsWithName.filter(
(result) =>
result.meta.apiType &&
Expand Down
2 changes: 2 additions & 0 deletions scripts/js/lib/api/htmlToMd.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ async function toMd(
html,
isCApi,
...DEFAULT_ARGS,
hasRootNamespaceFile: false,
});
return withMetadata ? result : result.markdown;
}
Expand Down Expand Up @@ -1020,6 +1021,7 @@ test("identify release notes", async () => {
fileName: "release_notes.html",
isCApi: false,
...DEFAULT_ARGS,
hasRootNamespaceFile: false,
}),
).toEqual({
images: [],
Expand Down
1 change: 1 addition & 0 deletions scripts/js/lib/api/htmlToMd.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export async function sphinxHtmlToMarkdown(options: {
releaseNotesTitle: string;
hasSeparateReleaseNotes: boolean;
isCApi: boolean;
hasRootNamespaceFile: boolean;
}): Promise<HtmlToMdResult> {
const processedHtml = await processHtml(options);
const markdown = await generateMarkdownFile(
Expand Down
Loading