From 8208fe22035cb6faa8d73ed48426a7e29d129335 Mon Sep 17 00:00:00 2001 From: Frank Harkins Date: Thu, 25 Jan 2024 13:22:27 +0000 Subject: [PATCH] Improve function handling (#683) This PR improves how the API generation script handles functions. ## Changes ### Demote some `h2` tags to `strong` We currently convert all `.rubric` elements to `h2`, but this makes some headings higher-level than they should be (specifically "Example" and "References" headings). For an example see [api/qiskit/converters](https://docs.quantum.ibm.com/api/qiskit/converters). Screenshot 2024-01-23 at 17 37 33 This PR converts rubrics to `strong` (rather than `h2`) if the name is "Example(s)" or "Reference(s)". This is a bit hacky, but it seems to work and I can't think of a better way of doing it. The Sphinx LaTeX writer also takes a [similar approach](https://www.sphinx-doc.org/en/master/usage/restructuredtext/directives.html#directive-rubric). I've regenerated the docs using this new logic and I can see no false positives (that is, cases in which we use `strong` where we should use `h2`). ### Add function names as headings Functions currently have no headings. This PR adds a `h3` with the function name, which improves readability, gives anchor tag icons, and will add more functions to the right sidebar. I've also included some logic to avoid adding function names when the page is already dedicated to the function (such as [least_busy](https://docs.quantum.ibm.com/api/qiskit-ibm-provider/qiskit_ibm_provider.least_busy)). One quirk with this I spotted was some function names not appearing in the sidebar in `/api/qiskit/utils` (see `add_deprecation_to_docstring` in the screenshot). This is possibly because the title hierarchy skips `h2`. ![Screenshot 2024-01-23 at 18 00 37](https://github.com/Qiskit/documentation/assets/36071638/c189dfc1-3535-4e2e-9edb-889ba855ef10) *** Closes #231 --------- Co-authored-by: Eric Arellano <14852634+Eric-Arellano@users.noreply.github.com> --- ..._provider.visualization.iplot_error_map.md | 2 +- ...m_provider.visualization.iplot_gate_map.md | 2 +- docs/api/qiskit/_package.json | 4 - docs/api/qiskit/algorithms.md | 4 + docs/api/qiskit/assembler.md | 12 +- docs/api/qiskit/circuit.md | 2 + docs/api/qiskit/circuit_classical.md | 88 ++++++++--- docs/api/qiskit/circuit_library.md | 142 ++++++++++++++++++ docs/api/qiskit/compiler.md | 8 + docs/api/qiskit/converters.md | 26 +++- docs/api/qiskit/execute.md | 4 +- docs/api/qiskit/opflow.md | 6 + docs/api/qiskit/pulse.md | 140 ++++++++++++++++- docs/api/qiskit/qasm2.md | 8 + docs/api/qiskit/qasm3.md | 8 + .../qiskit.algorithms.AmplitudeEstimation.md | 2 +- ...it.algorithms.FasterAmplitudeEstimation.md | 2 +- docs/api/qiskit/qiskit.algorithms.Grover.md | 4 +- ...algorithms.IterativeAmplitudeEstimation.md | 2 +- ...ms.MaximumLikelihoodAmplitudeEstimation.md | 2 +- docs/api/qiskit/qiskit.algorithms.PVQD.md | 4 +- ...it.algorithms.minimum_eigensolvers.QAOA.md | 2 +- ...rithms.minimum_eigensolvers.SamplingVQE.md | 2 +- ...kit.algorithms.minimum_eigensolvers.VQE.md | 2 +- .../qiskit.algorithms.optimizers.ADAM.md | 2 +- ...t.algorithms.optimizers.GradientDescent.md | 2 +- .../qiskit.algorithms.optimizers.NFT.md | 4 +- .../qiskit.algorithms.optimizers.QNSPSA.md | 4 +- .../qiskit.algorithms.optimizers.SPSA.md | 4 +- ...lgorithms.optimizers.SteppableOptimizer.md | 2 +- .../qiskit.algorithms.optimizers.UMDA.md | 4 +- ...ime_evolvers.trotterization.TrotterQRTE.md | 2 +- ...it.algorithms.time_evolvers.variational.md | 2 +- .../qiskit/qiskit.circuit.InstructionSet.md | 2 +- docs/api/qiskit/qiskit.circuit.Operation.md | 2 +- docs/api/qiskit/qiskit.circuit.Parameter.md | 2 +- .../qiskit/qiskit.circuit.QuantumCircuit.md | 32 ++-- docs/api/qiskit/qiskit.circuit.library.AND.md | 2 +- .../qiskit/qiskit.circuit.library.C3SXGate.md | 2 +- .../qiskit/qiskit.circuit.library.C4XGate.md | 2 +- ...it.circuit.library.CDKMRippleCarryAdder.md | 2 +- .../qiskit/qiskit.circuit.library.Diagonal.md | 2 +- .../qiskit.circuit.library.DraperQFTAdder.md | 2 +- .../qiskit.circuit.library.EfficientSU2.md | 4 +- ...t.circuit.library.EvolvedOperatorAnsatz.md | 2 +- .../qiskit.circuit.library.ExactReciprocal.md | 2 +- ...it.circuit.library.ExcitationPreserving.md | 4 +- .../qiskit.circuit.library.FourierChecking.md | 2 +- docs/api/qiskit/qiskit.circuit.library.GMS.md | 2 +- docs/api/qiskit/qiskit.circuit.library.GR.md | 2 +- docs/api/qiskit/qiskit.circuit.library.GRX.md | 2 +- docs/api/qiskit/qiskit.circuit.library.GRY.md | 2 +- docs/api/qiskit/qiskit.circuit.library.GRZ.md | 2 +- .../qiskit.circuit.library.GraphState.md | 2 +- .../qiskit.circuit.library.GroverOperator.md | 6 +- ...circuit.library.HRSCumulativeMultiplier.md | 2 +- ...it.circuit.library.HiddenLinearFunction.md | 2 +- docs/api/qiskit/qiskit.circuit.library.IQP.md | 2 +- .../qiskit.circuit.library.InnerProduct.md | 2 +- ...circuit.library.LinearAmplitudeFunction.md | 4 +- .../api/qiskit/qiskit.circuit.library.MCMT.md | 2 +- .../qiskit.circuit.library.MCMTVChain.md | 2 +- .../qiskit/qiskit.circuit.library.NLocal.md | 2 +- docs/api/qiskit/qiskit.circuit.library.OR.md | 2 +- .../qiskit.circuit.library.PauliFeatureMap.md | 4 +- .../qiskit.circuit.library.PauliTwoDesign.md | 6 +- .../qiskit.circuit.library.Permutation.md | 2 +- .../qiskit.circuit.library.PhaseEstimation.md | 2 +- .../qiskit.circuit.library.PhaseOracle.md | 2 +- ...skit.circuit.library.PiecewiseChebyshev.md | 4 +- ...brary.PiecewisePolynomialPauliRotations.md | 4 +- .../qiskit.circuit.library.QAOAAnsatz.md | 4 +- .../qiskit.circuit.library.QuadraticForm.md | 4 +- .../qiskit.circuit.library.QuantumVolume.md | 2 +- .../qiskit.circuit.library.RGQFTMultiplier.md | 2 +- .../qiskit.circuit.library.RealAmplitudes.md | 4 +- .../qiskit/qiskit.circuit.library.TwoLocal.md | 4 +- .../qiskit.circuit.library.UnitaryGate.md | 2 +- .../qiskit.circuit.library.UnitaryOverlap.md | 2 +- ...kit.circuit.library.VBERippleCarryAdder.md | 2 +- docs/api/qiskit/qiskit.circuit.library.XOR.md | 2 +- .../qiskit.circuit.library.ZFeatureMap.md | 4 +- .../qiskit.circuit.library.ZZFeatureMap.md | 4 +- ...kit.opflow.expectations.CVaRExpectation.md | 2 +- .../qiskit/qiskit.opflow.list_ops.SummedOp.md | 2 +- docs/api/qiskit/qiskit.pulse.Schedule.md | 4 +- docs/api/qiskit/qiskit.pulse.ScheduleBlock.md | 12 +- .../qiskit/qiskit.pulse.instructions.Delay.md | 2 +- .../qiskit.pulse.instructions.TimeBlockade.md | 2 +- .../qiskit.pulse.library.Drag_class.rst.md | 2 +- .../qiskit.pulse.library.SymbolicPulse.md | 10 +- ...skit.pulse.library.gaussian_square_echo.md | 2 +- .../qiskit.quantum_info.CNOTDihedral.md | 2 +- docs/api/qiskit/qiskit.quantum_info.Chi.md | 2 +- docs/api/qiskit/qiskit.quantum_info.Choi.md | 2 +- .../qiskit/qiskit.quantum_info.Clifford.md | 4 +- .../qiskit.quantum_info.DensityMatrix.md | 4 +- docs/api/qiskit/qiskit.quantum_info.Kraus.md | 2 +- docs/api/qiskit/qiskit.quantum_info.PTM.md | 2 +- .../qiskit.quantum_info.SparsePauliOp.md | 2 +- .../qiskit.quantum_info.StabilizerState.md | 2 +- .../qiskit/qiskit.quantum_info.Statevector.md | 6 +- .../qiskit/qiskit.quantum_info.Stinespring.md | 2 +- .../api/qiskit/qiskit.quantum_info.SuperOp.md | 2 +- .../qiskit.quantum_info.Z2Symmetries.md | 2 +- .../qiskit/qiskit.result.QuasiDistribution.md | 2 +- .../api/qiskit/qiskit.synthesis.LieTrotter.md | 2 +- docs/api/qiskit/qiskit.synthesis.QDrift.md | 2 +- .../qiskit/qiskit.synthesis.SuzukiTrotter.md | 2 +- .../qiskit.transpiler.passes.AlignMeasures.md | 4 +- ...kit.transpiler.passes.ConsolidateBlocks.md | 2 +- ...transpiler.passes.ConstrainedReschedule.md | 4 +- ...qiskit.transpiler.passes.RemoveBarriers.md | 2 +- .../qiskit.transpiler.passes.SolovayKitaev.md | 4 +- ...qiskit.transpiler.passes.StochasticSwap.md | 2 +- ...iler.passes.TranslateParameterizedGates.md | 2 +- ...spiler.synthesis.aqc.ApproximateCircuit.md | 2 +- ...ranspiler.synthesis.aqc.CNOTUnitCircuit.md | 2 +- .../qiskit.visualization.circuit_drawer.md | 2 +- .../qiskit/qiskit.visualization.dag_drawer.md | 2 +- ...iskit.visualization.pass_manager_drawer.md | 2 +- ...it.visualization.plot_bloch_multivector.md | 2 +- .../qiskit.visualization.plot_bloch_vector.md | 2 +- ...iskit.visualization.plot_circuit_layout.md | 2 +- .../qiskit.visualization.plot_coupling_map.md | 2 +- .../qiskit.visualization.plot_distribution.md | 2 +- .../qiskit.visualization.plot_error_map.md | 2 +- .../qiskit.visualization.plot_gate_map.md | 2 +- .../qiskit.visualization.plot_histogram.md | 2 +- .../qiskit.visualization.plot_state_city.md | 2 +- .../qiskit.visualization.plot_state_hinton.md | 2 +- ...iskit.visualization.plot_state_paulivec.md | 2 +- ...qiskit.visualization.plot_state_qsphere.md | 2 +- .../qiskit.visualization.pulse_drawer.md | 2 +- .../qiskit.visualization.timeline_drawer.md | 2 +- docs/api/qiskit/qpy.md | 4 + docs/api/qiskit/quantum_info.md | 68 ++++++++- docs/api/qiskit/result.md | 8 + docs/api/qiskit/scheduler.md | 6 + docs/api/qiskit/synthesis.md | 46 +++++- docs/api/qiskit/synthesis_aqc.md | 4 +- docs/api/qiskit/tools.md | 16 +- docs/api/qiskit/transpiler_plugins.md | 4 + docs/api/qiskit/transpiler_preset.md | 26 ++++ docs/api/qiskit/utils.md | 34 ++++- scripts/lib/api/processHtml.test.ts | 117 +++++++++++++++ scripts/lib/api/processHtml.ts | 25 ++- 147 files changed, 926 insertions(+), 236 deletions(-) delete mode 100644 docs/api/qiskit/_package.json diff --git a/docs/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_error_map.md b/docs/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_error_map.md index 18715a54006..f038a764762 100644 --- a/docs/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_error_map.md +++ b/docs/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_error_map.md @@ -38,7 +38,7 @@ The error map figure. * **VisualizationValueError** – If an invalid input is received. * **VisualizationTypeError** – If the specified backend is a simulator. -## Example +**Example** ```python from qiskit_ibm_provider import IBMProvider diff --git a/docs/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_gate_map.md b/docs/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_gate_map.md index 2a2959472bd..90b83947e11 100644 --- a/docs/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_gate_map.md +++ b/docs/api/qiskit-ibm-provider/qiskit_ibm_provider.visualization.iplot_gate_map.md @@ -39,7 +39,7 @@ Plots an interactive gate map of a device. The gate map figure. -## Example +**Example** ```python from qiskit_ibm_provider import IBMProvider diff --git a/docs/api/qiskit/_package.json b/docs/api/qiskit/_package.json deleted file mode 100644 index aa043fe25dd..00000000000 --- a/docs/api/qiskit/_package.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "name": "qiskit", - "version": "0.45.2" -} diff --git a/docs/api/qiskit/algorithms.md b/docs/api/qiskit/algorithms.md index b2f12fb7cfe..a3abc9e0bea 100644 --- a/docs/api/qiskit/algorithms.md +++ b/docs/api/qiskit/algorithms.md @@ -213,6 +213,8 @@ Utility classes used by algorithms (mainly for type-hinting purposes). Utility functions used by algorithms. +### eval\_observables + `qiskit.algorithms.eval_observables(quantum_instance, quantum_state, observables, expectation, threshold=1e-12)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/algorithms/aux_ops_evaluator.py "view source code") @@ -245,6 +247,8 @@ A list or a dictionary of tuples (mean, standard deviation). ListOrDict\[[tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")\[[complex](https://docs.python.org/3/library/functions.html#complex "(in Python v3.12)"), [complex](https://docs.python.org/3/library/functions.html#complex "(in Python v3.12)")]] +### estimate\_observables + `qiskit.algorithms.estimate_observables(estimator, quantum_state, observables, parameter_values=None, threshold=1e-12)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/algorithms/observables_evaluator.py "view source code") diff --git a/docs/api/qiskit/assembler.md b/docs/api/qiskit/assembler.md index 8f177df26c3..761fecc58df 100644 --- a/docs/api/qiskit/assembler.md +++ b/docs/api/qiskit/assembler.md @@ -20,6 +20,8 @@ python_api_name: qiskit.assembler ## Circuit Assembler +### assemble\_circuits + `qiskit.assembler.assemble_circuits(circuits, run_config, qobj_id, qobj_header)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/assembler/assemble_circuits.py "view source code") @@ -41,7 +43,7 @@ The qobj to be run on the backends [*QasmQobj*](qiskit.qobj.QasmQobj "qiskit.qobj.qasm_qobj.QasmQobj") -## Examples +**Examples** ```python from qiskit.circuit import QuantumRegister, ClassicalRegister, QuantumCircuit @@ -63,6 +65,8 @@ qobj = assemble_circuits(circuits=[qc], ## Schedule Assembler +### assemble\_schedules + `qiskit.assembler.assemble_schedules(schedules, qobj_id, qobj_header, run_config)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/assembler/assemble_schedules.py "view source code") @@ -88,7 +92,7 @@ The Qobj to be run on the backends. [*PulseQobj*](qiskit.qobj.PulseQobj "qiskit.qobj.pulse_qobj.PulseQobj") -## Examples +**Examples** ```python from qiskit import pulse @@ -127,6 +131,8 @@ pulseQobj = assemble_schedules(schedules=[schedule], ## Disassembler +### disassemble + `qiskit.assembler.disassemble(qobj)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/assembler/disassemble.py "view source code") @@ -153,7 +159,7 @@ The disassembled program which consists of: Union\[CircuitModule, PulseModule] -## Examples +**Examples** ```python from qiskit.circuit import QuantumRegister, ClassicalRegister, QuantumCircuit diff --git a/docs/api/qiskit/circuit.md b/docs/api/qiskit/circuit.md index e2f0cf6280f..09defacbac5 100644 --- a/docs/api/qiskit/circuit.md +++ b/docs/api/qiskit/circuit.md @@ -284,6 +284,8 @@ with qc.switch(cr) as case: ### Random Circuits +### random\_circuit + `qiskit.circuit.random.random_circuit(num_qubits, depth, max_operands=4, measure=False, conditional=False, reset=False, seed=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/random/utils.py "view source code") diff --git a/docs/api/qiskit/circuit_classical.md b/docs/api/qiskit/circuit_classical.md index 68887d628fc..594c9574042 100644 --- a/docs/api/qiskit/circuit_classical.md +++ b/docs/api/qiskit/circuit_classical.md @@ -247,6 +247,8 @@ Constructing the tree representation directly is verbose and easy to make a mist The functions and methods described in this section are a more user-friendly way to build the expression tree, while staying close to the internal representation. All these functions will automatically lift valid Python scalar values into corresponding [`Var`](#qiskit.circuit.classical.expr.Var "qiskit.circuit.classical.expr.Var") or [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") objects, and will resolve any required implicit casts on your behalf. +### lift + `qiskit.circuit.classical.expr.lift(value, /, type=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") @@ -255,7 +257,7 @@ Lift the given Python `value` to a [`Value`](#qiskit.circuit.classical.expr.Valu If an explicit `type` is given, the typing in the output will reflect that. -## Examples +**Examples** Lifting simple circuit objects to be [`Var`](#qiskit.circuit.classical.expr.Var "qiskit.circuit.classical.expr.expr.Var") instances: @@ -285,13 +287,15 @@ Value(5, Uint(4)) You can manually specify casts in cases where the cast is allowed in explicit form, but may be lossy (such as the cast of a higher precision [`Uint`](#qiskit.circuit.classical.types.Uint "qiskit.circuit.classical.types.Uint") to a lower precision one). +### cast + `qiskit.circuit.classical.expr.cast(operand, type, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create an explicit cast from the given value to the given type. -## Examples +**Examples** Add an explicit cast node that explicitly casts a higher precision type to a lower precision one: @@ -308,13 +312,15 @@ Cast(Value(5, types.Uint(32)), types.Uint(8), implicit=False) There are helper constructor functions for each of the unary operations. +### bit\_not + `qiskit.circuit.classical.expr.bit_not(operand, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a bitwise ‘not’ expression node from the given value, resolving any implicit casts and lifting the value into a [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") node if required. -## Examples +**Examples** Bitwise negation of a [`ClassicalRegister`](qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister"): @@ -329,13 +335,15 @@ Unary(Unary.Op.BIT_NOT, Var(ClassicalRegister(3, 'c'), Uint(3)), Uint(3)) [*Expr*](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr") +### logic\_not + `qiskit.circuit.classical.expr.logic_not(operand, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a logical ‘not’ expression node from the given value, resolving any implicit casts and lifting the value into a [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") node if required. -## Examples +**Examples** Logical negation of a [`ClassicalRegister`](qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister"): @@ -352,13 +360,15 @@ Unary(Unary.Op.LOGIC_NOT, Cast(Var(ClassicalRegister(3, 'c'), Uint(3)), Bool(), Similarly, the binary operations and relations have helper functions defined. +### bit\_and + `qiskit.circuit.classical.expr.bit_and(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a bitwise ‘and’ expression node from the given value, resolving any implicit casts and lifting the values into [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") nodes if required. -## Examples +**Examples** Bitwise ‘and’ of a classical register and an integer literal: @@ -373,13 +383,15 @@ Binary(Binary.Op.BIT_AND, Var(ClassicalRegister(3, 'c'), Uint(3)), Value(7, Uint [*Expr*](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr") +### bit\_or + `qiskit.circuit.classical.expr.bit_or(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a bitwise ‘or’ expression node from the given value, resolving any implicit casts and lifting the values into [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") nodes if required. -## Examples +**Examples** Bitwise ‘or’ of a classical register and an integer literal: @@ -394,13 +406,15 @@ Binary(Binary.Op.BIT_OR, Var(ClassicalRegister(3, 'c'), Uint(3)), Value(5, Uint( [*Expr*](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr") +### bit\_xor + `qiskit.circuit.classical.expr.bit_xor(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a bitwise ‘exclusive or’ expression node from the given value, resolving any implicit casts and lifting the values into [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") nodes if required. -## Examples +**Examples** Bitwise ‘exclusive or’ of a classical register and an integer literal: @@ -415,13 +429,15 @@ Binary(Binary.Op.BIT_XOR, Var(ClassicalRegister(3, 'c'), Uint(3)), Value(5, Uint [*Expr*](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr") +### logic\_and + `qiskit.circuit.classical.expr.logic_and(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a logical ‘and’ expression node from the given value, resolving any implicit casts and lifting the values into [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") nodes if required. -## Examples +**Examples** Logical ‘and’ of two classical bits: @@ -436,13 +452,15 @@ Binary(Binary.Op.LOGIC_AND, Var(, Bool()), Var(, Bool()), Bool [*Expr*](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr") +### logic\_or + `qiskit.circuit.classical.expr.logic_or(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a logical ‘or’ expression node from the given value, resolving any implicit casts and lifting the values into [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") nodes if required. -## Examples +**Examples** Logical ‘or’ of two classical bits @@ -457,13 +475,15 @@ Binary(Binary.Op.LOGIC_OR, Var(, Bool()), Var(, Bool()), Bool( [*Expr*](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr") +### equal + `qiskit.circuit.classical.expr.equal(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create an ‘equal’ expression node from the given value, resolving any implicit casts and lifting the values into [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") nodes if required. -## Examples +**Examples** Equality between a classical register and an integer: @@ -478,13 +498,15 @@ Binary(Binary.Op.EQUAL, Var(ClassicalRegister(3, "c"), Uint(3)), Value(7, Uint(3 [*Expr*](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr") +### not\_equal + `qiskit.circuit.classical.expr.not_equal(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a ‘not equal’ expression node from the given value, resolving any implicit casts and lifting the values into [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") nodes if required. -## Examples +**Examples** Inequality between a classical register and an integer: @@ -499,13 +521,15 @@ Binary(Binary.Op.NOT_EQUAL, Var(ClassicalRegister(3, "c"), Uint(3)), Value(7, Ui [*Expr*](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr") +### less + `qiskit.circuit.classical.expr.less(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a ‘less than’ expression node from the given value, resolving any implicit casts and lifting the values into [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") nodes if required. -## Examples +**Examples** Query if a classical register is less than an integer: @@ -520,13 +544,15 @@ Binary(Binary.Op.LESS, Var(ClassicalRegister(3, "c"), Uint(3)), Value(5, Uint(3) [*Expr*](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr") +### less\_equal + `qiskit.circuit.classical.expr.less_equal(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a ‘less than or equal to’ expression node from the given value, resolving any implicit casts and lifting the values into [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") nodes if required. -## Examples +**Examples** Query if a classical register is less than or equal to another: @@ -541,13 +567,15 @@ Binary(Binary.Op.LESS_EQUAL, Var(ClassicalRegister(3, "a"), Uint(3)), Var(Classi [*Expr*](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr") +### greater + `qiskit.circuit.classical.expr.greater(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a ‘greater than’ expression node from the given value, resolving any implicit casts and lifting the values into [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") nodes if required. -## Examples +**Examples** Query if a classical register is greater than an integer: @@ -562,13 +590,15 @@ Binary(Binary.Op.GREATER, Var(ClassicalRegister(3, "c"), Uint(3)), Value(5, Uint [*Expr*](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr") +### greater\_equal + `qiskit.circuit.classical.expr.greater_equal(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Create a ‘greater than or equal to’ expression node from the given value, resolving any implicit casts and lifting the values into [`Value`](#qiskit.circuit.classical.expr.Value "qiskit.circuit.classical.expr.Value") nodes if required. -## Examples +**Examples** Query if a classical register is greater than or equal to another: @@ -585,13 +615,15 @@ Binary(Binary.Op.GREATER_EQUAL, Var(ClassicalRegister(3, "a"), Uint(3)), Var(Cla Qiskit’s legacy method for specifying equality conditions for use in conditionals is to use a two-tuple of a [`Clbit`](qiskit.circuit.Clbit "qiskit.circuit.Clbit") or [`ClassicalRegister`](qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister") and an integer. This represents an exact equality condition, and there are no ways to specify any other relations. The helper function [`lift_legacy_condition()`](#qiskit.circuit.classical.expr.lift_legacy_condition "qiskit.circuit.classical.expr.lift_legacy_condition") converts this legacy format into the new expression syntax. +### lift\_legacy\_condition + `qiskit.circuit.classical.expr.lift_legacy_condition(condition, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/constructors.py "view source code") Lift a legacy two-tuple equality condition into a new-style [`Expr`](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.Expr"). -## Examples +**Examples** Taking an old-style conditional instruction and getting an [`Expr`](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.Expr") from its condition: @@ -684,13 +716,15 @@ Consumers of the expression tree should subclass the visitor, and override the ` For the convenience of simple visitors that only need to inspect the variables in an expression and not the general structure, the iterator method [`iter_vars()`](#qiskit.circuit.classical.expr.iter_vars "qiskit.circuit.classical.expr.iter_vars") is provided. +### iter\_vars + `qiskit.circuit.classical.expr.iter_vars(node)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/visitors.py "view source code") Get an iterator over the [`Var`](#qiskit.circuit.classical.expr.Var "qiskit.circuit.classical.expr.expr.Var") nodes referenced at any level in the given [`Expr`](#qiskit.circuit.classical.expr.Expr "qiskit.circuit.classical.expr.expr.Expr"). -## Examples +**Examples** Print out the name of each [`ClassicalRegister`](qiskit.circuit.ClassicalRegister "qiskit.circuit.ClassicalRegister") encountered: @@ -712,6 +746,8 @@ for node in expr.iter_vars(expr.bit_and(expr.bit_not(cr1), cr2)): Two expressions can be compared for direct structural equality by using the built-in Python `==` operator. In general, though, one might want to compare two expressions slightly more semantically, allowing that the [`Var`](#qiskit.circuit.classical.expr.Var "qiskit.circuit.classical.expr.Var") nodes inside them are bound to different memory-location descriptions between two different circuits. In this case, one can use [`structurally_equivalent()`](#qiskit.circuit.classical.expr.structurally_equivalent "qiskit.circuit.classical.expr.structurally_equivalent") with two suitable “key” functions to do the comparison. +### structurally\_equivalent + `qiskit.circuit.classical.expr.structurally_equivalent(left, right, left_var_key=None, right_var_key=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/expr/visitors.py "view source code") @@ -733,7 +769,7 @@ There’s no requirements on the key functions, except that their outputs should [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)") -## Examples +**Examples** Comparing two expressions for structural equivalence, with no remapping of the variables. These are different because the different [`Clbit`](qiskit.circuit.Clbit "qiskit.circuit.Clbit") instances compare differently: @@ -803,13 +839,15 @@ The type system is equipped with a partial ordering, where $a < b$ is interprete The low-level interface to querying the subtyping relationship is the [`order()`](#qiskit.circuit.classical.types.order "qiskit.circuit.classical.types.order") function. +### order + `qiskit.circuit.classical.types.order(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/types/ordering.py "view source code") Get the ordering relationship between the two types as an enumeration value. -## Examples +**Examples** Compare two [`Uint`](#qiskit.circuit.classical.types.Uint "qiskit.circuit.classical.types.Uint") types of different widths: @@ -842,13 +880,15 @@ Note that the sub-/supertyping relationship is not the same as whether a type ca Some helper methods are then defined in terms of this low-level [`order()`](#qiskit.circuit.classical.types.order "qiskit.circuit.classical.types.order") primitive: +### is\_subtype + `qiskit.circuit.classical.types.is_subtype(left, right, /, strict=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/types/ordering.py "view source code") Does the relation $\text{left} \le \text{right}$ hold? If there is no ordering relation between the two types, then this returns `False`. If `strict`, then the equality is also forbidden. -## Examples +**Examples** Check if one type is a subclass of another: @@ -871,13 +911,15 @@ False [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)") +### is\_supertype + `qiskit.circuit.classical.types.is_supertype(left, right, /, strict=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/types/ordering.py "view source code") Does the relation $\text{left} \ge \text{right}$ hold? If there is no ordering relation between the two types, then this returns `False`. If `strict`, then the equality is also forbidden. -## Examples +**Examples** Check if one type is a superclass of another: @@ -900,6 +942,8 @@ False [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)") +### greater + `qiskit.circuit.classical.types.greater(left, right, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/classical/types/ordering.py "view source code") @@ -918,7 +962,7 @@ The greater of the two types. [*Type*](#qiskit.circuit.classical.types.Type "qiskit.circuit.classical.types.types.Type") -## Examples +**Examples** Find the greater of two [`Uint`](#qiskit.circuit.classical.types.Uint "qiskit.circuit.classical.types.Uint") types: diff --git a/docs/api/qiskit/circuit_library.md b/docs/api/qiskit/circuit_library.md index cb14ecadb43..a5ab4f2fb68 100644 --- a/docs/api/qiskit/circuit_library.md +++ b/docs/api/qiskit/circuit_library.md @@ -324,6 +324,8 @@ Template circuits for [`XGate`](qiskit.circuit.library.XGate "qiskit.circuit.lib **Reference:** Maslov, D. and Dueck, G. W. and Miller, D. M., Techniques for the synthesis of reversible Toffoli networks, 2007 [http://dx.doi.org/10.1145/1278349.1278355](http://dx.doi.org/10.1145/1278349.1278355) +### template\_nct\_2a\_1 + `qiskit.circuit.library.templates.nct.template_nct_2a_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_2a_1.py "view source code") @@ -336,6 +338,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_2a\_2 + `qiskit.circuit.library.templates.nct.template_nct_2a_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_2a_2.py "view source code") @@ -348,6 +352,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_2a\_3 + `qiskit.circuit.library.templates.nct.template_nct_2a_3()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_2a_3.py "view source code") @@ -360,6 +366,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_4a\_1 + `qiskit.circuit.library.templates.nct.template_nct_4a_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_4a_1.py "view source code") @@ -372,6 +380,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_4a\_2 + `qiskit.circuit.library.templates.nct.template_nct_4a_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_4a_2.py "view source code") @@ -384,6 +394,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_4a\_3 + `qiskit.circuit.library.templates.nct.template_nct_4a_3()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_4a_3.py "view source code") @@ -396,6 +408,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_4b\_1 + `qiskit.circuit.library.templates.nct.template_nct_4b_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_4b_1.py "view source code") @@ -408,6 +422,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_4b\_2 + `qiskit.circuit.library.templates.nct.template_nct_4b_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_4b_2.py "view source code") @@ -420,6 +436,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_5a\_1 + `qiskit.circuit.library.templates.nct.template_nct_5a_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_5a_1.py "view source code") @@ -432,6 +450,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_5a\_2 + `qiskit.circuit.library.templates.nct.template_nct_5a_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_5a_2.py "view source code") @@ -444,6 +464,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_5a\_3 + `qiskit.circuit.library.templates.nct.template_nct_5a_3()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_5a_3.py "view source code") @@ -456,6 +478,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_5a\_4 + `qiskit.circuit.library.templates.nct.template_nct_5a_4()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_5a_4.py "view source code") @@ -468,6 +492,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_6a\_1 + `qiskit.circuit.library.templates.nct.template_nct_6a_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_6a_1.py "view source code") @@ -480,6 +506,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_6a\_2 + `qiskit.circuit.library.templates.nct.template_nct_6a_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_6a_2.py "view source code") @@ -492,6 +520,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_6a\_3 + `qiskit.circuit.library.templates.nct.template_nct_6a_3()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_6a_3.py "view source code") @@ -504,6 +534,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_6a\_4 + `qiskit.circuit.library.templates.nct.template_nct_6a_4()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_6a_4.py "view source code") @@ -516,6 +548,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_6b\_1 + `qiskit.circuit.library.templates.nct.template_nct_6b_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_6b_1.py "view source code") @@ -528,6 +562,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_6b\_2 + `qiskit.circuit.library.templates.nct.template_nct_6b_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_6b_2.py "view source code") @@ -540,6 +576,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_6c\_1 + `qiskit.circuit.library.templates.nct.template_nct_6c_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_6c_1.py "view source code") @@ -552,6 +590,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_7a\_1 + `qiskit.circuit.library.templates.nct.template_nct_7a_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_7a_1.py "view source code") @@ -564,6 +604,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_7b\_1 + `qiskit.circuit.library.templates.nct.template_nct_7b_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_7b_1.py "view source code") @@ -576,6 +618,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_7c\_1 + `qiskit.circuit.library.templates.nct.template_nct_7c_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_7c_1.py "view source code") @@ -588,6 +632,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_7d\_1 + `qiskit.circuit.library.templates.nct.template_nct_7d_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_7d_1.py "view source code") @@ -600,6 +646,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_7e\_1 + `qiskit.circuit.library.templates.nct.template_nct_7e_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_7e_1.py "view source code") @@ -612,6 +660,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9a\_1 + `qiskit.circuit.library.templates.nct.template_nct_9a_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9a_1.py "view source code") @@ -624,6 +674,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_1 + `qiskit.circuit.library.templates.nct.template_nct_9c_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_1.py "view source code") @@ -636,6 +688,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_2 + `qiskit.circuit.library.templates.nct.template_nct_9c_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_2.py "view source code") @@ -648,6 +702,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_3 + `qiskit.circuit.library.templates.nct.template_nct_9c_3()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_3.py "view source code") @@ -660,6 +716,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_4 + `qiskit.circuit.library.templates.nct.template_nct_9c_4()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_4.py "view source code") @@ -672,6 +730,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_5 + `qiskit.circuit.library.templates.nct.template_nct_9c_5()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_5.py "view source code") @@ -684,6 +744,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_6 + `qiskit.circuit.library.templates.nct.template_nct_9c_6()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_6.py "view source code") @@ -696,6 +758,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_7 + `qiskit.circuit.library.templates.nct.template_nct_9c_7()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_7.py "view source code") @@ -708,6 +772,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_8 + `qiskit.circuit.library.templates.nct.template_nct_9c_8()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_8.py "view source code") @@ -720,6 +786,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_9 + `qiskit.circuit.library.templates.nct.template_nct_9c_9()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_9.py "view source code") @@ -732,6 +800,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_10 + `qiskit.circuit.library.templates.nct.template_nct_9c_10()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_10.py "view source code") @@ -744,6 +814,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_11 + `qiskit.circuit.library.templates.nct.template_nct_9c_11()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_11.py "view source code") @@ -756,6 +828,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9c\_12 + `qiskit.circuit.library.templates.nct.template_nct_9c_12()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9c_12.py "view source code") @@ -768,6 +842,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9d\_1 + `qiskit.circuit.library.templates.nct.template_nct_9d_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9d_1.py "view source code") @@ -780,6 +856,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9d\_2 + `qiskit.circuit.library.templates.nct.template_nct_9d_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9d_2.py "view source code") @@ -792,6 +870,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9d\_3 + `qiskit.circuit.library.templates.nct.template_nct_9d_3()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9d_3.py "view source code") @@ -804,6 +884,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9d\_4 + `qiskit.circuit.library.templates.nct.template_nct_9d_4()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9d_4.py "view source code") @@ -816,6 +898,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9d\_5 + `qiskit.circuit.library.templates.nct.template_nct_9d_5()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9d_5.py "view source code") @@ -828,6 +912,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9d\_6 + `qiskit.circuit.library.templates.nct.template_nct_9d_6()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9d_6.py "view source code") @@ -840,6 +926,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9d\_7 + `qiskit.circuit.library.templates.nct.template_nct_9d_7()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9d_7.py "view source code") @@ -852,6 +940,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9d\_8 + `qiskit.circuit.library.templates.nct.template_nct_9d_8()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9d_8.py "view source code") @@ -864,6 +954,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9d\_9 + `qiskit.circuit.library.templates.nct.template_nct_9d_9()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9d_9.py "view source code") @@ -876,6 +968,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### template\_nct\_9d\_10 + `qiskit.circuit.library.templates.nct.template_nct_9d_10()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/nct/template_nct_9d_10.py "view source code") @@ -892,6 +986,8 @@ template as a quantum circuit. Template circuits over Clifford gates. +### clifford\_2\_1 + `qiskit.circuit.library.clifford_2_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_2_1.py "view source code") @@ -904,6 +1000,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_2\_2 + `qiskit.circuit.library.clifford_2_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_2_2.py "view source code") @@ -916,6 +1014,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_2\_3 + `qiskit.circuit.library.clifford_2_3()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_2_3.py "view source code") @@ -928,6 +1028,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_2\_4 + `qiskit.circuit.library.clifford_2_4()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_2_4.py "view source code") @@ -940,6 +1042,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_3\_1 + `qiskit.circuit.library.clifford_3_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_3_1.py "view source code") @@ -952,6 +1056,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_4\_1 + `qiskit.circuit.library.clifford_4_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_4_1.py "view source code") @@ -964,6 +1070,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_4\_2 + `qiskit.circuit.library.clifford_4_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_4_2.py "view source code") @@ -976,6 +1084,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_4\_3 + `qiskit.circuit.library.clifford_4_3()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_4_3.py "view source code") @@ -988,6 +1098,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_4\_4 + `qiskit.circuit.library.clifford_4_4()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_4_4.py "view source code") @@ -1000,6 +1112,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_5\_1 + `qiskit.circuit.library.clifford_5_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_5_1.py "view source code") @@ -1012,6 +1126,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_6\_1 + `qiskit.circuit.library.clifford_6_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_6_1.py "view source code") @@ -1024,6 +1140,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_6\_2 + `qiskit.circuit.library.clifford_6_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_6_2.py "view source code") @@ -1036,6 +1154,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_6\_3 + `qiskit.circuit.library.clifford_6_3()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_6_3.py "view source code") @@ -1048,6 +1168,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_6\_4 + `qiskit.circuit.library.clifford_6_4()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_6_4.py "view source code") @@ -1060,6 +1182,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_6\_5 + `qiskit.circuit.library.clifford_6_5()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_6_5.py "view source code") @@ -1072,6 +1196,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_8\_1 + `qiskit.circuit.library.clifford_8_1()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_8_1.py "view source code") @@ -1084,6 +1210,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_8\_2 + `qiskit.circuit.library.clifford_8_2()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_8_2.py "view source code") @@ -1096,6 +1224,8 @@ template as a quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### clifford\_8\_3 + `qiskit.circuit.library.clifford_8_3()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/clifford/clifford_8_3.py "view source code") @@ -1112,36 +1242,48 @@ template as a quantum circuit. Template circuits with [`RZXGate`](qiskit.circuit.library.RZXGate "qiskit.circuit.library.RZXGate"). +### rzx\_yz + `qiskit.circuit.library.rzx_yz(theta=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/rzx/rzx_yz.py "view source code") Template for CX - RYGate - CX. +### rzx\_xz + `qiskit.circuit.library.rzx_xz(theta=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/rzx/rzx_xz.py "view source code") Template for CX - RXGate - CX. +### rzx\_cy + `qiskit.circuit.library.rzx_cy(theta=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/rzx/rzx_cy.py "view source code") Template for CX - RYGate - CX. +### rzx\_zz1 + `qiskit.circuit.library.rzx_zz1(theta=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/rzx/rzx_zz1.py "view source code") Template for CX - RZGate - CX. +### rzx\_zz2 + `qiskit.circuit.library.rzx_zz2(theta=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/rzx/rzx_zz2.py "view source code") Template for CX - RZGate - CX. +### rzx\_zz3 + `qiskit.circuit.library.rzx_zz3(theta=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/circuit/library/templates/rzx/rzx_zz3.py "view source code") diff --git a/docs/api/qiskit/compiler.md b/docs/api/qiskit/compiler.md index dfa14a14724..69001d97c01 100644 --- a/docs/api/qiskit/compiler.md +++ b/docs/api/qiskit/compiler.md @@ -20,6 +20,8 @@ python_api_name: qiskit.compiler ## Circuit and Pulse Compilation Functions +### assemble + `qiskit.compiler.assemble(experiments, backend=None, qobj_id=None, qobj_header=None, shots=None, memory=False, seed_simulator=None, qubit_lo_freq=None, meas_lo_freq=None, qubit_lo_range=None, meas_lo_range=None, schedule_los=None, meas_level=MeasLevel.CLASSIFIED, meas_return=MeasReturnType.AVERAGE, meas_map=None, memory_slot_size=100, rep_time=None, rep_delay=None, parameter_binds=None, parametric_pulses=None, init_qubits=True, **run_config)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/compiler/assembler.py "view source code") @@ -101,6 +103,8 @@ A `Qobj` that can be run on a backend. Depending on the type of input, this will [*QasmQobj*](qiskit.qobj.QasmQobj "qiskit.qobj.qasm_qobj.QasmQobj") | [*PulseQobj*](qiskit.qobj.PulseQobj "qiskit.qobj.pulse_qobj.PulseQobj") +### schedule + `qiskit.compiler.schedule(circuits, backend=None, inst_map=None, meas_map=None, dt=None, method=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/compiler/scheduler.py "view source code") @@ -128,6 +132,8 @@ A pulse `Schedule` that implements the input circuit [*Schedule*](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule") | [*List*](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.12)")\[[*Schedule*](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule")] +### transpile + `qiskit.compiler.transpile(circuits, backend=None, basis_gates=None, inst_map=None, coupling_map=None, backend_properties=None, initial_layout=None, layout_method=None, routing_method=None, translation_method=None, scheduling_method=None, instruction_durations=None, dt=None, approximation_degree=1.0, timing_constraints=None, seed_transpiler=None, optimization_level=None, callback=None, output_name=None, unitary_synthesis_method='default', unitary_synthesis_plugin_config=None, target=None, hls_config=None, init_method=None, optimization_method=None, ignore_backend_supplied_default_methods=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/compiler/transpiler.py "view source code") @@ -274,6 +280,8 @@ The transpiled circuit(s). *\_CircuitT* +### sequence + `qiskit.compiler.sequence(scheduled_circuits, backend=None, inst_map=None, meas_map=None, dt=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/compiler/sequencer.py "view source code") diff --git a/docs/api/qiskit/converters.md b/docs/api/qiskit/converters.md index 78760aafa74..9e893e12ed1 100644 --- a/docs/api/qiskit/converters.md +++ b/docs/api/qiskit/converters.md @@ -18,6 +18,8 @@ python_api_name: qiskit.converters `qiskit.converters` +### circuit\_to\_dag + `qiskit.converters.circuit_to_dag(circuit, copy_operations=True, *, qubit_order=None, clbit_order=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/converters/circuit_to_dag.py "view source code") @@ -43,7 +45,7 @@ the DAG representing the input circuit. [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – if the `qubit_order` or `clbit_order` parameters do not match the bits in the circuit. -## Example +**Example** ```python from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit @@ -60,6 +62,8 @@ circ.rz(0.5, q[1]).c_if(c, 2) dag = circuit_to_dag(circ) ``` +### dag\_to\_circuit + `qiskit.converters.dag_to_circuit(dag, copy_operations=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/converters/dag_to_circuit.py "view source code") @@ -79,7 +83,7 @@ the circuit representing the input dag. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") -## Example +**Example** ```python from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit @@ -102,6 +106,8 @@ circuit.draw('mpl') ![../\_images/converters-1.png](/images/api/qiskit/converters-1.png) +### circuit\_to\_instruction + `qiskit.converters.circuit_to_instruction(circuit, parameter_map=None, equivalence_library=None, label=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/converters/circuit_to_instruction.py "view source code") @@ -129,7 +135,7 @@ an instruction equivalent to the action of the input circuit. Upon decomposition [qiskit.circuit.Instruction](qiskit.circuit.Instruction "qiskit.circuit.Instruction") -## Example +**Example** ```python from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit @@ -145,6 +151,8 @@ circ.rz(0.5, q[1]).c_if(c, 2) circuit_to_instruction(circ) ``` +### circuit\_to\_gate + `qiskit.converters.circuit_to_gate(circuit, parameter_map=None, equivalence_library=None, label=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/converters/circuit_to_gate.py "view source code") @@ -172,6 +180,8 @@ a Gate equivalent to the action of the input circuit. Upon decomposition, this g [Gate](qiskit.circuit.Gate "qiskit.circuit.Gate") +### ast\_to\_dag + `qiskit.converters.ast_to_dag(ast)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/converters/ast_to_dag.py "view source code") @@ -194,7 +204,7 @@ the DAG representing an OpenQASM’s AST [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if the AST is malformed. -## Example +**Example** ```python from qiskit.converters import ast_to_dag @@ -212,6 +222,8 @@ ast = qasm.Qasm(data=qasm_str).parse() dag = ast_to_dag(ast) ``` +### dagdependency\_to\_circuit + `qiskit.converters.dagdependency_to_circuit(dagdependency)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/converters/dagdependency_to_circuit.py "view source code") @@ -230,6 +242,8 @@ the circuit representing the input dag dependency. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### circuit\_to\_dagdependency + `qiskit.converters.circuit_to_dagdependency(circuit, create_preds_and_succs=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/converters/circuit_to_dagdependency.py "view source code") @@ -249,6 +263,8 @@ the DAG representing the input circuit as a dag dependency. [DAGDependency](qiskit.dagcircuit.DAGDependency "qiskit.dagcircuit.DAGDependency") +### dag\_to\_dagdependency + `qiskit.converters.dag_to_dagdependency(dag, create_preds_and_succs=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/converters/dag_to_dagdependency.py "view source code") @@ -268,6 +284,8 @@ the DAG representing the input circuit as a dag dependency. [DAGDependency](qiskit.dagcircuit.DAGDependency "qiskit.dagcircuit.DAGDependency") +### dagdependency\_to\_dag + `qiskit.converters.dagdependency_to_dag(dagdependency)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/converters/dagdependency_to_dag.py "view source code") diff --git a/docs/api/qiskit/execute.md b/docs/api/qiskit/execute.md index fc79990c066..9cf90e10d83 100644 --- a/docs/api/qiskit/execute.md +++ b/docs/api/qiskit/execute.md @@ -18,6 +18,8 @@ python_api_name: qiskit.execute_function `qiskit.execute_function` +### execute + `qiskit.execute_function.execute(experiments, backend, basis_gates=None, coupling_map=None, backend_properties=None, initial_layout=None, seed_transpiler=None, optimization_level=None, pass_manager=None, shots=None, memory=None, seed_simulator=None, default_qubit_los=None, default_meas_los=None, qubit_lo_range=None, meas_lo_range=None, schedule_los=None, meas_level=None, meas_return=None, memory_slots=None, memory_slot_size=None, rep_time=None, rep_delay=None, parameter_binds=None, schedule_circuit=False, inst_map=None, meas_map=None, scheduling_method=None, init_qubits=None, **run_config)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/execute_function.py "view source code") @@ -158,7 +160,7 @@ returns job instance derived from Job [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if the execution cannot be interpreted as either circuits or schedules -## Example +**Example** Construct a 5-qubit GHZ circuit and execute 4321 shots on a backend. diff --git a/docs/api/qiskit/opflow.md b/docs/api/qiskit/opflow.md index a98147ff500..d0bb7213e6e 100644 --- a/docs/api/qiskit/opflow.md +++ b/docs/api/qiskit/opflow.md @@ -95,6 +95,8 @@ The Converter submodules include objects which manipulate Operators, usually rec ## Utility functions +### commutator + `qiskit.opflow.commutator(op_a, op_b)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/opflow/utils.py "view source code") @@ -122,6 +124,8 @@ the commutator [OperatorBase](qiskit.opflow.OperatorBase "qiskit.opflow.OperatorBase") +### anti\_commutator + `qiskit.opflow.anti_commutator(op_a, op_b)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/opflow/utils.py "view source code") @@ -149,6 +153,8 @@ the anti-commutator [OperatorBase](qiskit.opflow.OperatorBase "qiskit.opflow.OperatorBase") +### double\_commutator + `qiskit.opflow.double_commutator(op_a, op_b, op_c, sign=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/opflow/utils.py "view source code") diff --git a/docs/api/qiskit/pulse.md b/docs/api/qiskit/pulse.md index 5bfdfa4739e..fce81f9817b 100644 --- a/docs/api/qiskit/pulse.md +++ b/docs/api/qiskit/pulse.md @@ -114,6 +114,8 @@ In contrast, the [`SymbolicPulse`](qiskit.pulse.library.SymbolicPulse "qiskit.pu ### Waveform Pulse Representation +### constant + `qiskit.pulse.library.constant(duration, amp, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -140,6 +142,8 @@ $$ [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") +### zero + `qiskit.pulse.library.zero(duration, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -165,6 +169,8 @@ $$ [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") +### square + `qiskit.pulse.library.square(duration, amp, freq=None, phase=0, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -195,6 +201,8 @@ with the convention $\text{sign}(0) = 1$. [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") +### sawtooth + `qiskit.pulse.library.sawtooth(duration, amp, freq=None, phase=0, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -225,7 +233,7 @@ where $g(x) = x/T + \phi/\pi$. [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") -## Example +**Example** ```python import matplotlib.pyplot as plt @@ -242,6 +250,8 @@ plt.show() ![../\_images/pulse-1.png](/images/api/qiskit/pulse-1.png) +### triangle + `qiskit.pulse.library.triangle(duration, amp, freq=None, phase=0, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -272,7 +282,7 @@ This a non-sinusoidal wave with linear ramping. [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") -## Example +**Example** ```python import matplotlib.pyplot as plt @@ -289,6 +299,8 @@ plt.show() ![../\_images/pulse-2.png](/images/api/qiskit/pulse-2.png) +### cos + `qiskit.pulse.library.cos(duration, amp, freq=None, phase=0, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -317,6 +329,8 @@ $$ [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") +### sin + `qiskit.pulse.library.sin(duration, amp, freq=None, phase=0, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -345,6 +359,8 @@ $$ [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") +### gaussian + `qiskit.pulse.library.gaussian(duration, amp, sigma, name=None, zero_ends=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -385,6 +401,8 @@ Integrated area under the full curve is `amp * np.sqrt(2*np.pi*sigma**2)` [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") +### gaussian\_deriv + `qiskit.pulse.library.gaussian_deriv(duration, amp, sigma, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -415,6 +433,8 @@ i.e. the derivative of the Gaussian function, with center $\mu=$ `duration/2`. [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") +### sech + `qiskit.pulse.library.sech(duration, amp, sigma, name=None, zero_ends=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -453,6 +473,8 @@ where $y^*$ is the value of the endpoint samples. This sets the endpoints to $0$ [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") +### sech\_deriv + `qiskit.pulse.library.sech_deriv(duration, amp, sigma, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -484,6 +506,8 @@ i.e. the derivative of $\text{sech}$. [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") +### gaussian\_square + `qiskit.pulse.library.gaussian_square(duration, amp, sigma, risefall=None, width=None, name=None, zero_ends=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -526,6 +550,8 @@ If `zero_ends == True`, the samples for the Gaussian ramps are remapped as in [` [*Waveform*](qiskit.pulse.library.Waveform "qiskit.pulse.library.waveform.Waveform") +### drag + `qiskit.pulse.library.drag(duration, amp, sigma, beta, name=None, zero_ends=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/library/discrete.py "view source code") @@ -546,7 +572,7 @@ If `zero_ends == True`, the samples from $g(x)$ are remapped as in [`gaussian()` The function `qiskit.pulse.library.discrete.drag()` is pending deprecation as of qiskit 0.25.0. It will be marked deprecated in a future release, and then removed no earlier than 3 months after the release date. The discrete pulses library, including drag() is pending deprecation. Instead, use the SymbolicPulse library to create the waveform with pulse.Drag(…).get\_waveform(). Note that complex value support for the amp parameter is pending deprecation in the SymbolicPulse library. It is therefore recommended to use two float values for (amp, angle) instead of complex amp -## References +**References** 1. [*Gambetta, J. M., Motzoi, F., Merkel, S. T. & Wilhelm, F. K. “Analytic control methods for high-fidelity unitary operations in a weakly nonlinear oscillator.” Phys. Rev. A 83, 012308 (2011).*](http://dx.doi.org/10.1103/PhysRevA.83.012308) @@ -687,6 +713,8 @@ Create new context. The canonicalization transforms convert schedules to a form amenable for execution on OpenPulse backends. +### add\_implicit\_acquires + `qiskit.pulse.transforms.add_implicit_acquires(schedule, meas_map)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/transforms/canonicalization.py "view source code") @@ -710,6 +738,8 @@ A `Schedule` with the additional acquisition instructions. [*Schedule*](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule") +### align\_measures + `qiskit.pulse.transforms.align_measures(schedules, inst_map=None, cal_gate='u3', max_calibration_duration=None, align_time=None, align_all=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/transforms/canonicalization.py "view source code") @@ -777,6 +807,8 @@ The input list of schedules transformed to have their measurements aligned. [*List*](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.12)")\[[*Schedule*](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule")] +### block\_to\_schedule + `qiskit.pulse.transforms.block_to_schedule(block)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/transforms/canonicalization.py "view source code") @@ -804,6 +836,8 @@ Scheduled pulse program. This transform may insert barriers in between contexts. +### compress\_pulses + `qiskit.pulse.transforms.compress_pulses(schedules)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/transforms/canonicalization.py "view source code") @@ -822,6 +856,8 @@ Compressed schedules. [*List*](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.12)")\[[*Schedule*](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule")] +### flatten + `qiskit.pulse.transforms.flatten(program)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/transforms/canonicalization.py "view source code") @@ -844,6 +880,8 @@ Flatten pulse program. [*Schedule*](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule") +### inline\_subroutines + `qiskit.pulse.transforms.inline_subroutines(program)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/transforms/canonicalization.py "view source code") @@ -868,6 +906,8 @@ A schedule without subroutine. [*Schedule*](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule") | [*ScheduleBlock*](qiskit.pulse.ScheduleBlock "qiskit.pulse.schedule.ScheduleBlock") +### pad + `qiskit.pulse.transforms.pad(schedule, channels=None, until=None, inplace=False, pad_with=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/transforms/canonicalization.py "view source code") @@ -894,6 +934,8 @@ The padded schedule. [*Schedule*](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule") +### remove\_directives + `qiskit.pulse.transforms.remove_directives(schedule)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/transforms/canonicalization.py "view source code") @@ -912,6 +954,8 @@ A schedule without directives. [*Schedule*](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule") +### remove\_trivial\_barriers + `qiskit.pulse.transforms.remove_trivial_barriers(schedule)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/transforms/canonicalization.py "view source code") @@ -936,6 +980,8 @@ schedule The DAG transforms create DAG representation of input program. This can be used for optimization of instructions and equality checks. +### block\_to\_dag + `qiskit.pulse.transforms.block_to_dag(block)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/transforms/dag.py "view source code") @@ -994,6 +1040,8 @@ Instructions in DAG representation. A sequence of transformations to generate a target code. +### target\_qobj\_transform + `qiskit.pulse.transforms.target_qobj_transform(sched, remove_directives=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/transforms/base_transforms.py "view source code") @@ -1205,6 +1253,8 @@ with pulse.build(backend) as pulse_prog: The above is just a small taste of what is possible with the builder. See the rest of the module documentation for more information on its capabilities. +### build + `qiskit.pulse.builder.build(backend=None, schedule=None, name=None, default_alignment='left', default_transpiler_settings=None, default_circuit_scheduler_settings=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1267,6 +1317,8 @@ with pulse.build(backend) as drive_sched: DriveChannel(0) ``` +### acquire\_channel + `qiskit.pulse.builder.acquire_channel(qubit)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1293,6 +1345,8 @@ with pulse.build(backend): [*AcquireChannel*](qiskit.pulse.channels.AcquireChannel "qiskit.pulse.channels.AcquireChannel") +### control\_channels + `qiskit.pulse.builder.control_channels(*qubits)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1328,6 +1382,8 @@ List of control channels associated with the supplied ordered list of qubits. [*List*](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.12)")\[[*ControlChannel*](qiskit.pulse.channels.ControlChannel "qiskit.pulse.channels.ControlChannel")] +### drive\_channel + `qiskit.pulse.builder.drive_channel(qubit)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1354,6 +1410,8 @@ with pulse.build(backend): [*DriveChannel*](qiskit.pulse.channels.DriveChannel "qiskit.pulse.channels.DriveChannel") +### measure\_channel + `qiskit.pulse.builder.measure_channel(qubit)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1413,6 +1471,8 @@ drive_sched.draw() ![../\_images/pulse-6.png](/images/api/qiskit/pulse-6.png) +### acquire + `qiskit.pulse.builder.acquire(duration, qubit_or_channel, register, **metadata)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1450,6 +1510,8 @@ with pulse.build() as pulse_prog: [**exceptions.PulseError**](#qiskit.pulse.PulseError "qiskit.pulse.exceptions.PulseError") – If the register type is not supported. +### barrier + `qiskit.pulse.builder.barrier(*channels_or_qubits, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1517,6 +1579,8 @@ with pulse.build(backend) as pulse_prog: * **channels\_or\_qubits** ([*Channel*](#qiskit.pulse.channels.Channel "qiskit.pulse.channels.Channel") *|*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")) – Channels or qubits to barrier. * **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") *| None*) – Name for the barrier +### call + `qiskit.pulse.builder.call(target, name=None, value_dict=None, **kw_params)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1527,7 +1591,7 @@ Call the subroutine within the currently active builder context with arbitrary p If the `target` program is a [`ScheduleBlock`](qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock"), then a [`Reference`](qiskit.pulse.instructions.Reference "qiskit.pulse.instructions.Reference") instruction will be created and appended to the current context. The `target` program will be immediately assigned to the current scope as a subroutine. If the `target` program is [`Schedule`](qiskit.pulse.Schedule "qiskit.pulse.Schedule"), it will be wrapped by the [`Call`](qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instruction and appended to the current context to avoid a mixed representation of [`ScheduleBlock`](qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") and [`Schedule`](qiskit.pulse.Schedule "qiskit.pulse.Schedule"). If the `target` program is a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") it will be scheduled and the new [`Schedule`](qiskit.pulse.Schedule "qiskit.pulse.Schedule") will be added as a [`Call`](qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instruction. -## Examples +**Examples** 1. Calling a schedule block (recommended) @@ -1731,6 +1795,8 @@ ScheduleBlock( * **value\_dict** ([*Dict*](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.12)")*\[*[*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)")*,* [*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)")*] | None*) – Optional. Parameters assigned to the `target` program. If this dictionary is provided, the `target` program is copied and then stored in the main built schedule and its parameters are assigned to the given values. This dictionary is keyed on [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects, allowing parameter name collision to be avoided. * **kw\_params** ([*ParameterExpression*](qiskit.circuit.ParameterExpression "qiskit.circuit.parameterexpression.ParameterExpression") *|*[*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)")) – Alternative way to provide parameters. Since this is keyed on the string parameter name, the parameters having the same name are all updated together. If you want to avoid name collision, use `value_dict` with [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects instead. +### delay + `qiskit.pulse.builder.delay(duration, channel, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1754,6 +1820,8 @@ with pulse.build() as pulse_prog: * **channel** ([*Channel*](#qiskit.pulse.channels.Channel "qiskit.pulse.channels.Channel")) – Channel to delay on. * **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") *| None*) – Name of the instruction. +### play + `qiskit.pulse.builder.play(pulse, channel, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1777,6 +1845,8 @@ with pulse.build() as pulse_prog: * **channel** (*PulseChannel*) – Channel to play pulse on. * **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") *| None*) – Name of the pulse. +### reference + `qiskit.pulse.builder.reference(name, *extra_keys)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1802,6 +1872,8 @@ main_prog.assign_references(subroutine_dict={("x_gate", "q0"): subroutine}) * **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")) – Name of subroutine. * **extra\_keys** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")) – Helper keys to uniquely specify the subroutine. +### set\_frequency + `qiskit.pulse.builder.set_frequency(frequency, channel, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1825,6 +1897,8 @@ with pulse.build() as pulse_prog: * **channel** (*PulseChannel*) – Channel to set frequency of. * **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") *| None*) – Name of the instruction. +### set\_phase + `qiskit.pulse.builder.set_phase(phase, channel, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1850,6 +1924,8 @@ with pulse.build() as pulse_prog: * **channel** (*PulseChannel*) – Channel to set phase of. * **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") *| None*) – Name of the instruction. +### shift\_frequency + `qiskit.pulse.builder.shift_frequency(frequency, channel, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1873,6 +1949,8 @@ with pulse.build() as pulse_prog: * **channel** (*PulseChannel*) – Channel to shift frequency of. * **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") *| None*) – Name of the instruction. +### shift\_phase + `qiskit.pulse.builder.shift_phase(phase, channel, name=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1898,6 +1976,8 @@ with pulse.build() as pulse_prog: * **channel** (*PulseChannel*) – Channel to shift phase of. * **name** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") *| None*) – Name of the instruction. +### snapshot + `qiskit.pulse.builder.snapshot(label, snapshot_type='statevector')`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1940,6 +2020,8 @@ pulse_prog.draw() ![../\_images/pulse-7.png](/images/api/qiskit/pulse-7.png) +### align\_equispaced + `qiskit.pulse.builder.align_equispaced(duration)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -1982,10 +2064,12 @@ None [*AlignmentKind*](#qiskit.pulse.transforms.AlignmentKind "qiskit.pulse.transforms.alignments.AlignmentKind") -## Notes +**Notes** The scheduling is performed for sub-schedules within the context rather than channel-wise. If you want to apply the equispaced context for each channel, you should use the context independently for channels. +### align\_func + `qiskit.pulse.builder.align_func(duration, func)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2034,10 +2118,12 @@ None [*AlignmentKind*](#qiskit.pulse.transforms.AlignmentKind "qiskit.pulse.transforms.alignments.AlignmentKind") -## Notes +**Notes** The scheduling is performed for sub-schedules within the context rather than channel-wise. If you want to apply the numerical context for each channel, you need to apply the context independently to channels. +### align\_left + `qiskit.pulse.builder.align_left()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2073,6 +2159,8 @@ None [*ContextManager*](https://docs.python.org/3/library/typing.html#typing.ContextManager "(in Python v3.12)")\[None] +### align\_right + `qiskit.pulse.builder.align_right()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2108,6 +2196,8 @@ None [*AlignmentKind*](#qiskit.pulse.transforms.AlignmentKind "qiskit.pulse.transforms.alignments.AlignmentKind") +### align\_sequential + `qiskit.pulse.builder.align_sequential()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2143,6 +2233,8 @@ None [*AlignmentKind*](#qiskit.pulse.transforms.AlignmentKind "qiskit.pulse.transforms.alignments.AlignmentKind") +### circuit\_scheduler\_settings + `qiskit.pulse.builder.circuit_scheduler_settings(**settings)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2172,6 +2264,8 @@ with pulse.build(backend): [*ContextManager*](https://docs.python.org/3/library/typing.html#typing.ContextManager "(in Python v3.12)")\[None] +### frequency\_offset + `qiskit.pulse.builder.frequency_offset(frequency, *channels, compensate_phase=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2216,6 +2310,8 @@ None [*ContextManager*](https://docs.python.org/3/library/typing.html#typing.ContextManager "(in Python v3.12)")\[None] +### phase\_offset + `qiskit.pulse.builder.phase_offset(phase, *channels)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2251,6 +2347,8 @@ None [*ContextManager*](https://docs.python.org/3/library/typing.html#typing.ContextManager "(in Python v3.12)")\[None] +### transpiler\_settings + `qiskit.pulse.builder.transpiler_settings(**settings)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2299,6 +2397,8 @@ with pulse.build(backend) as measure_sched: MemorySlot(0) ``` +### measure + `qiskit.pulse.builder.measure(qubits, registers=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2354,6 +2454,8 @@ The `register` the qubit measurement result will be stored in. [*List*](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.12)")\[StorageLocation] | StorageLocation +### measure\_all + `qiskit.pulse.builder.measure_all()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2387,6 +2489,8 @@ The `register`s the qubit measurement results will be stored in. [*List*](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.12)")\[[*MemorySlot*](qiskit.pulse.channels.MemorySlot "qiskit.pulse.channels.MemorySlot")] +### delay\_qubits + `qiskit.pulse.builder.delay_qubits(duration, *qubits)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2435,6 +2539,8 @@ with pulse.build(backend) as u3_sched: pulse.u3(math.pi, 0, math.pi, 0) ``` +### cx + `qiskit.pulse.builder.cx(control, target)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2457,6 +2563,8 @@ with pulse.build(backend) as pulse_prog: pulse.cx(0, 1) ``` +### u1 + `qiskit.pulse.builder.u1(theta, qubit)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2481,6 +2589,8 @@ with pulse.build(backend) as pulse_prog: pulse.u1(math.pi, 1) ``` +### u2 + `qiskit.pulse.builder.u2(phi, lam, qubit)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2505,6 +2615,8 @@ with pulse.build(backend) as pulse_prog: pulse.u2(0, math.pi, 1) ``` +### u3 + `qiskit.pulse.builder.u3(theta, phi, lam, qubit)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2529,6 +2641,8 @@ with pulse.build(backend) as pulse_prog: pulse.u3(math.pi, 0, math.pi, 1) ``` +### x + `qiskit.pulse.builder.x(qubit)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2580,6 +2694,8 @@ There are 160 samples in 3.5555555555555554e-08 seconds There are 1e-06 seconds in 4500 samples. ``` +### active\_backend + `qiskit.pulse.builder.active_backend()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2600,6 +2716,8 @@ builder context. [**exceptions.BackendNotSet**](#qiskit.pulse.BackendNotSet "qiskit.pulse.exceptions.BackendNotSet") – If the builder does not have a backend set. +### active\_transpiler\_settings + `qiskit.pulse.builder.active_transpiler_settings()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2629,6 +2747,8 @@ with pulse.build(backend, [*Dict*](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.12)")\[[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)"), [*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)")] +### active\_circuit\_scheduler\_settings + `qiskit.pulse.builder.active_circuit_scheduler_settings()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2659,6 +2779,8 @@ with pulse.build( [*Dict*](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.12)")\[[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)"), [*Any*](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.12)")] +### num\_qubits + `qiskit.pulse.builder.num_qubits()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2689,6 +2811,8 @@ with pulse.build(backend): [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)") +### qubit\_channels + `qiskit.pulse.builder.qubit_channels(qubit)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2723,6 +2847,8 @@ with pulse.build(backend): [*Set*](https://docs.python.org/3/library/typing.html#typing.Set "(in Python v3.12)")\[[*Channel*](#qiskit.pulse.channels.Channel "qiskit.pulse.channels.Channel")] +### samples\_to\_seconds + `qiskit.pulse.builder.samples_to_seconds(samples)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") @@ -2741,6 +2867,8 @@ The time that elapses in `samples`. [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)") | [*ndarray*](https://numpy.org/doc/stable/reference/generated/numpy.ndarray.html#numpy.ndarray "(in NumPy v1.26)") +### seconds\_to\_samples + `qiskit.pulse.builder.seconds_to_samples(seconds)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/pulse/builder.py "view source code") diff --git a/docs/api/qiskit/qasm2.md b/docs/api/qiskit/qasm2.md index a14b1a94bce..b3d3bae8ef5 100644 --- a/docs/api/qiskit/qasm2.md +++ b/docs/api/qiskit/qasm2.md @@ -30,6 +30,8 @@ Qiskit has support for interoperation with OpenQASM 2.0 programs, both [parsing This module contains two public functions, both of which create a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") from an OpenQASM 2 program. [`load()`](#qiskit.qasm2.load "qiskit.qasm2.load") takes a filename, while [`loads()`](#qiskit.qasm2.loads "qiskit.qasm2.loads") takes the program itself as a string. Their internals are very similar, so both offer almost the same API. +### load + `qiskit.qasm2.load(filename, *, include_path=('.',), include_input_directory='append', custom_instructions=(), custom_classical=(), strict=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/qasm2/__init__.py "view source code") @@ -53,6 +55,8 @@ A circuit object representing the same OpenQASM 2 program. [*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit") +### loads + `qiskit.qasm2.loads(string, *, include_path=('.',), custom_instructions=(), custom_classical=(), strict=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/qasm2/__init__.py "view source code") @@ -121,6 +125,8 @@ Both of the loader functions have an optional “strict” mode. By default, thi Similar to other serialisation modules in Python, this module offers two public functions: [`dump()`](#qiskit.qasm2.dump "qiskit.qasm2.dump") and [`dumps()`](#qiskit.qasm2.dumps "qiskit.qasm2.dumps"), which take a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") and write out a representative OpenQASM 2 program to a file-like object or return a string, respectively. +### dump + `qiskit.qasm2.dump(circuit, filename_or_stream, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/qasm2/export.py "view source code") @@ -136,6 +142,8 @@ Dump a circuit as an OpenQASM 2 program to a file or stream. [**QASM2ExportError**](#qiskit.qasm2.QASM2ExportError "qiskit.qasm2.QASM2ExportError") – if the circuit cannot be represented by OpenQASM 2. +### dumps + `qiskit.qasm2.dumps(circuit, /)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/qasm2/export.py "view source code") diff --git a/docs/api/qiskit/qasm3.md b/docs/api/qiskit/qasm3.md index 8897dc6e3c2..2fd7561d2d3 100644 --- a/docs/api/qiskit/qasm3.md +++ b/docs/api/qiskit/qasm3.md @@ -24,6 +24,8 @@ Qiskit provides some tools for converting between [OpenQASM 3](https://openqasm. The high-level functions are simply [`dump()`](#qiskit.qasm3.dump "qiskit.qasm3.dump") and [`dumps()`](#qiskit.qasm3.dumps "qiskit.qasm3.dumps"), which respectively export to a file (given as a filename) and to a Python string. +### dump + `qiskit.qasm3.dump(circuit, stream, **kwargs)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/qasm3/__init__.py "view source code") @@ -36,6 +38,8 @@ Serialize a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.Qua * **stream** (*TextIOBase*) – stream-like object to dump the OpenQASM 3 serialization * **\*\*kwargs** – Arguments for the [`Exporter`](#qiskit.qasm3.Exporter "qiskit.qasm3.Exporter") constructor. +### dumps + `qiskit.qasm3.dumps(circuit, **kwargs)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/qasm3/__init__.py "view source code") @@ -180,6 +184,8 @@ Currently only two high-level functions are offered, as Qiskit support for impor We expect that this functionality will eventually be merged into core Terra, and no longer require an optional import, but we do not yet have a timeline for this. +### load + `qiskit.qasm3.load(filename)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/qasm3/__init__.py "view source code") @@ -202,6 +208,8 @@ a circuit representation of the OpenQASM 3 program. [**QASM3ImporterError**](#qiskit.qasm3.QASM3ImporterError "qiskit.qasm3.QASM3ImporterError") – if the OpenQASM 3 file is invalid, or cannot be represented by a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). +### loads + `qiskit.qasm3.loads(program)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/qasm3/__init__.py "view source code") diff --git a/docs/api/qiskit/qiskit.algorithms.AmplitudeEstimation.md b/docs/api/qiskit/qiskit.algorithms.AmplitudeEstimation.md index b4e20928d59..9778e265b20 100644 --- a/docs/api/qiskit/qiskit.algorithms.AmplitudeEstimation.md +++ b/docs/api/qiskit/qiskit.algorithms.AmplitudeEstimation.md @@ -30,7 +30,7 @@ Using a maximum likelihood post processing, this grid constraint can be circumve This class does not support the [`EstimationProblem.is_good_state`](qiskit.algorithms.EstimationProblem#is_good_state "qiskit.algorithms.EstimationProblem.is_good_state") property, as for phase estimation-based QAE, the oracle that identifes the good states must be encoded in the Grover operator. To set custom oracles, the [`EstimationProblem.grover_operator`](qiskit.algorithms.EstimationProblem#grover_operator "qiskit.algorithms.EstimationProblem.grover_operator") attribute can be set directly. -## References +**References** **\[1]: Brassard, G., Hoyer, P., Mosca, M., & Tapp, A. (2000).** diff --git a/docs/api/qiskit/qiskit.algorithms.FasterAmplitudeEstimation.md b/docs/api/qiskit/qiskit.algorithms.FasterAmplitudeEstimation.md index 2921afde146..046c70efdee 100644 --- a/docs/api/qiskit/qiskit.algorithms.FasterAmplitudeEstimation.md +++ b/docs/api/qiskit/qiskit.algorithms.FasterAmplitudeEstimation.md @@ -20,7 +20,7 @@ The Faster Amplitude Estimation (FAE) \[1] algorithm is a variant of Quantum Amp Due to the iterative version of the QPE, this algorithm does not require any additional qubits, as the originally proposed QAE \[3] and thus the resulting circuits are less complex. -## References +**References** **\[1]: K. Nakaji. Faster Amplitude Estimation, 2020;** diff --git a/docs/api/qiskit/qiskit.algorithms.Grover.md b/docs/api/qiskit/qiskit.algorithms.Grover.md index 76c8fefcb88..0b94a105480 100644 --- a/docs/api/qiskit/qiskit.algorithms.Grover.md +++ b/docs/api/qiskit/qiskit.algorithms.Grover.md @@ -55,7 +55,7 @@ $$ For more information, see the [`GroverOperator`](qiskit.circuit.library.GroverOperator "qiskit.circuit.library.GroverOperator") in the circuit library. -## References +**References** **\[1]: L. K. Grover (1996), A fast quantum mechanical algorithm for database search,** @@ -86,7 +86,7 @@ Quantum Amplitude Amplification and Estimation. [arXiv:quant-ph/0005055](http:// * [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – If `growth_rate` is a float but not larger than 1. * [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – If both `iterations` and `growth_rate` is set. -## References +**References** **\[1]: Boyer et al., Tight bounds on quantum searching** diff --git a/docs/api/qiskit/qiskit.algorithms.IterativeAmplitudeEstimation.md b/docs/api/qiskit/qiskit.algorithms.IterativeAmplitudeEstimation.md index 70c7dbe6c8c..40c5faef7d9 100644 --- a/docs/api/qiskit/qiskit.algorithms.IterativeAmplitudeEstimation.md +++ b/docs/api/qiskit/qiskit.algorithms.IterativeAmplitudeEstimation.md @@ -20,7 +20,7 @@ This class implements the Iterative Quantum Amplitude Estimation (IQAE) algorith It differs from the original QAE algorithm proposed by Brassard \[2] in that it does not rely on Quantum Phase Estimation, but is only based on Grover’s algorithm. IQAE iteratively applies carefully selected Grover iterations to find an estimate for the target amplitude. -## References +**References** **\[1]: Grinko, D., Gacon, J., Zoufal, C., & Woerner, S. (2019).** diff --git a/docs/api/qiskit/qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation.md b/docs/api/qiskit/qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation.md index 4f71b58c492..2669b311112 100644 --- a/docs/api/qiskit/qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation.md +++ b/docs/api/qiskit/qiskit.algorithms.MaximumLikelihoodAmplitudeEstimation.md @@ -18,7 +18,7 @@ The Maximum Likelihood Amplitude Estimation algorithm. This class implements the quantum amplitude estimation (QAE) algorithm without phase estimation, as introduced in \[1]. In comparison to the original QAE algorithm \[2], this implementation relies solely on different powers of the Grover operator and does not require additional evaluation qubits. Finally, the estimate is determined via a maximum likelihood estimation, which is why this class in named `MaximumLikelihoodAmplitudeEstimation`. -## References +**References** **\[1]: Suzuki, Y., Uno, S., Raymond, R., Tanaka, T., Onodera, T., & Yamamoto, N. (2019).** diff --git a/docs/api/qiskit/qiskit.algorithms.PVQD.md b/docs/api/qiskit/qiskit.algorithms.PVQD.md index d14c03c1dee..76b98a19098 100644 --- a/docs/api/qiskit/qiskit.algorithms.PVQD.md +++ b/docs/api/qiskit/qiskit.algorithms.PVQD.md @@ -90,7 +90,7 @@ The starting point for the first classical optimization run, at time 0. Defaults Optional\[np.ndarray] -## Example +**Example** This snippet computes the real time evolution of a quantum Ising model on two neighboring sites and keeps track of the magnetization. @@ -134,7 +134,7 @@ problem = TimeEvolutionProblem( result = pvqd.evolve(problem) ``` -## References +**References** **\[1] Stefano Barison, Filippo Vicentini, and Giuseppe Carleo (2021), An efficient** diff --git a/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.QAOA.md b/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.QAOA.md index 4a6ce4971c6..a45882aefb0 100644 --- a/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.QAOA.md +++ b/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.QAOA.md @@ -92,7 +92,7 @@ A callback that can access the intermediate data at each optimization step. Thes Callable\[\[[int](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)"), np.ndarray, [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)"), [dict](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.12)")\[[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)"), Any]], None] | None -## References +**References** **\[1]: Farhi, E., Goldstone, J., Gutmann, S., “A Quantum Approximate Optimization Algorithm”** diff --git a/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.SamplingVQE.md b/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.SamplingVQE.md index 51c33ee3cf2..d2f56c4c03e 100644 --- a/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.SamplingVQE.md +++ b/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.SamplingVQE.md @@ -102,7 +102,7 @@ A callback that can access the intermediate data at each optimization step. Thes Callable\[\[[int](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)"), np.ndarray, [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)"), [dict](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.12)")\[[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)"), Any]], None] | None -## References +**References** **\[1]: Barkoutsos, P. K., Nannicini, G., Robert, A., Tavernelli, I., and Woerner, S.,** diff --git a/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.VQE.md b/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.VQE.md index 6c9d4b614ab..d1e8653adee 100644 --- a/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.VQE.md +++ b/docs/api/qiskit/qiskit.algorithms.minimum_eigensolvers.VQE.md @@ -108,7 +108,7 @@ A callback that can access the intermediate data at each optimization step. Thes Callable\[\[[int](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)"), np.ndarray, [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)"), [dict](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.12)")\[[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)"), Any]], None] | None -## References +**References** **\[1]: Peruzzo, A., et al, “A variational eigenvalue solver on a quantum processor”** diff --git a/docs/api/qiskit/qiskit.algorithms.optimizers.ADAM.md b/docs/api/qiskit/qiskit.algorithms.optimizers.ADAM.md index 566d8827cc3..485f6374ff2 100644 --- a/docs/api/qiskit/qiskit.algorithms.optimizers.ADAM.md +++ b/docs/api/qiskit/qiskit.algorithms.optimizers.ADAM.md @@ -20,7 +20,7 @@ Adam \[1] is a gradient-based optimization algorithm that is relies on adaptive AMSGRAD \[2] (a variant of Adam) uses a ‘long-term memory’ of past gradients and, thereby, improves convergence properties. -## References +**References** **\[1]: Kingma, Diederik & Ba, Jimmy (2014), Adam: A Method for Stochastic Optimization.** diff --git a/docs/api/qiskit/qiskit.algorithms.optimizers.GradientDescent.md b/docs/api/qiskit/qiskit.algorithms.optimizers.GradientDescent.md index 502cce4a333..ab79d295b05 100644 --- a/docs/api/qiskit/qiskit.algorithms.optimizers.GradientDescent.md +++ b/docs/api/qiskit/qiskit.algorithms.optimizers.GradientDescent.md @@ -28,7 +28,7 @@ You can either provide the analytic gradient $\vec\nabla f$ as `jac` in the [`mi This optimizer supports a callback function. If provided in the initializer, the optimizer will call the callback in each iteration with the following information in this order: current number of function values, current parameters, current function value, norm of current gradient. -## Examples +**Examples** A minimum example that will use finite difference gradients with a default perturbation of 0.01 and a default learning rate of 0.01. diff --git a/docs/api/qiskit/qiskit.algorithms.optimizers.NFT.md b/docs/api/qiskit/qiskit.algorithms.optimizers.NFT.md index 37c649e1cae..7026c543671 100644 --- a/docs/api/qiskit/qiskit.algorithms.optimizers.NFT.md +++ b/docs/api/qiskit/qiskit.algorithms.optimizers.NFT.md @@ -29,11 +29,11 @@ Built out using scipy framework, for details, please refer to [https://docs.scip * **options** ([*dict*](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.12)") *| None*) – A dictionary of solver options. * **kwargs** – additional kwargs for scipy.optimize.minimize. -## Notes +**Notes** In this optimization method, the optimization function have to satisfy three conditions written in [\[1\]](#id2). -## References +**References** \[[1](#id1)] diff --git a/docs/api/qiskit/qiskit.algorithms.optimizers.QNSPSA.md b/docs/api/qiskit/qiskit.algorithms.optimizers.QNSPSA.md index 9cc72e0717a..b922ae32aff 100644 --- a/docs/api/qiskit/qiskit.algorithms.optimizers.QNSPSA.md +++ b/docs/api/qiskit/qiskit.algorithms.optimizers.QNSPSA.md @@ -26,7 +26,7 @@ The stochastic approximation of the natural gradient can be systematically impro This component has some function that is normally random. If you want to reproduce behavior then you should set the random number generator seed in the algorithm\_globals (`qiskit.utils.algorithm_globals.random_seed = seed`). -## Examples +**Examples** This short example runs QN-SPSA for the ground state calculation of the `Z ^ Z` observable where the ansatz is a `PauliTwoDesign` circuit. @@ -79,7 +79,7 @@ qnspsa = QNSPSA(fidelity, maxiter=300) result = qnspsa.optimize(ansatz.num_parameters, loss, initial_point=initial_point) ``` -## References +**References** \[1] J. Gacon et al, “Simultaneous Perturbation Stochastic Approximation of the Quantum Fisher Information”, [arXiv:2103.09232](https://arxiv.org/abs/2103.09232) diff --git a/docs/api/qiskit/qiskit.algorithms.optimizers.SPSA.md b/docs/api/qiskit/qiskit.algorithms.optimizers.SPSA.md index 7ba6283d1cb..4396609369a 100644 --- a/docs/api/qiskit/qiskit.algorithms.optimizers.SPSA.md +++ b/docs/api/qiskit/qiskit.algorithms.optimizers.SPSA.md @@ -36,7 +36,7 @@ The optimization process can includes a calibration phase if neither the `learni This component has some function that is normally random. If you want to reproduce behavior then you should set the random number generator seed in the algorithm\_globals (`qiskit.utils.algorithm_globals.random_seed = seed`). -## Examples +**Examples** This short example runs SPSA for the ground state calculation of the `Z ^ Z` observable where the ansatz is a `PauliTwoDesign` circuit. @@ -97,7 +97,7 @@ parameters, value, niter = spsa.optimize(2, objective, initial_point=[0.5, 0.5]) print(f'SPSA completed after {niter} iterations') ``` -## References +**References** \[1]: J. C. Spall (1998). An Overview of the Simultaneous Perturbation Method for Efficient Optimization, Johns Hopkins APL Technical Digest, 19(4), 482–492. [Online at jhuapl.edu.](https://www.jhuapl.edu/SPSA/PDF-SPSA/Spall_An_Overview.PDF) diff --git a/docs/api/qiskit/qiskit.algorithms.optimizers.SteppableOptimizer.md b/docs/api/qiskit/qiskit.algorithms.optimizers.SteppableOptimizer.md index 50e1381270f..0c70d0cfb1d 100644 --- a/docs/api/qiskit/qiskit.algorithms.optimizers.SteppableOptimizer.md +++ b/docs/api/qiskit/qiskit.algorithms.optimizers.SteppableOptimizer.md @@ -20,7 +20,7 @@ This family of optimizers uses the [ask and tell interface](https://optuna.readt This interface is more customizable, and allows the user to have full control over the evaluation of the function. -## Examples +**Examples** An example where the evaluation of the function has a chance of failing. The user, with specific knowledge about his function can catch this errors and handle them before passing the result to the optimizer. diff --git a/docs/api/qiskit/qiskit.algorithms.optimizers.UMDA.md b/docs/api/qiskit/qiskit.algorithms.optimizers.UMDA.md index 1342ee704fe..75b9c4da7d2 100644 --- a/docs/api/qiskit/qiskit.algorithms.optimizers.UMDA.md +++ b/docs/api/qiskit/qiskit.algorithms.optimizers.UMDA.md @@ -32,7 +32,7 @@ The optimization process can be personalized depending on the parameters chosen The UMDA implementation has more parameters but these have default values for the initialization for better understanding of the user. For example, `lpha` parameter has been set to 0.5 and is the percentage of the population which is selected in each iteration to update the probabilistic model. -## Example +**Example** This short example runs UMDA to optimize the parameters of a variational algorithm. Here we will use the same operator as used in the algorithms introduction, which was originally computed by Qiskit Nature for an H2 molecule. The minimum energy of the H2 Hamiltonian can be found quite easily so we are able to set maxiters to a small value. @@ -71,7 +71,7 @@ vqe = QAOA(opt, result = vqe.compute_minimum_eigenvalue(operator=qubit_op) ``` -## References +**References** \[1]: Vicente P. Soloviev, Pedro Larrañaga and Concha Bielza (2022, July). Quantum Parametric Circuit Optimization with Estimation of Distribution Algorithms. In 2022 The Genetic and Evolutionary Computation Conference (GECCO). DOI: [https://doi.org/10.1145/3520304.3533963](https://doi.org/10.1145/3520304.3533963) diff --git a/docs/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE.md b/docs/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE.md index e952a4c7206..081006659db 100644 --- a/docs/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE.md +++ b/docs/api/qiskit/qiskit.algorithms.time_evolvers.trotterization.TrotterQRTE.md @@ -16,7 +16,7 @@ Bases: [`RealTimeEvolver`](qiskit.algorithms.RealTimeEvolver "qiskit.algorithms. Quantum Real Time Evolution using Trotterization. Type of Trotterization is defined by a `ProductFormula` provided. -## Examples +**Examples** ```python from qiskit.opflow import PauliSumOp diff --git a/docs/api/qiskit/qiskit.algorithms.time_evolvers.variational.md b/docs/api/qiskit/qiskit.algorithms.time_evolvers.variational.md index 2e731126c1c..4a573fcddb1 100644 --- a/docs/api/qiskit/qiskit.algorithms.time_evolvers.variational.md +++ b/docs/api/qiskit/qiskit.algorithms.time_evolvers.variational.md @@ -22,7 +22,7 @@ python_api_name: qiskit.algorithms.time_evolvers.variational Algorithms for performing Variational Quantum Time Evolution of quantum states, which can be tailored to near-term devices. `VarQTE` base class exposes an interface, compliant with the Quantum Time Evolution Framework in Qiskit Terra, that is implemented by [`VarQRTE`](qiskit.algorithms.VarQRTE "qiskit.algorithms.VarQRTE") and [`VarQITE`](qiskit.algorithms.VarQITE "qiskit.algorithms.VarQITE") classes for real and imaginary time evolution respectively. The variational approach is taken according to a variational principle chosen by a user. -## Example +**Example** ```python import numpy as np diff --git a/docs/api/qiskit/qiskit.circuit.InstructionSet.md b/docs/api/qiskit/qiskit.circuit.InstructionSet.md index b0a72add901..1f48c346d5c 100644 --- a/docs/api/qiskit/qiskit.circuit.InstructionSet.md +++ b/docs/api/qiskit/qiskit.circuit.InstructionSet.md @@ -89,7 +89,7 @@ This same instance of [`InstructionSet`](#qiskit.circuit.InstructionSet "qiskit. [InstructionSet](#qiskit.circuit.InstructionSet "qiskit.circuit.InstructionSet") -## Example +**Example** ```python from qiskit import ClassicalRegister, QuantumRegister, QuantumCircuit diff --git a/docs/api/qiskit/qiskit.circuit.Operation.md b/docs/api/qiskit/qiskit.circuit.Operation.md index 0c728d11535..faf5c1d7bbe 100644 --- a/docs/api/qiskit/qiskit.circuit.Operation.md +++ b/docs/api/qiskit/qiskit.circuit.Operation.md @@ -16,7 +16,7 @@ Bases: [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC "(in Python v3 Quantum Operation Interface Class. For objects that can be added to a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit"). These objects include [`Gate`](qiskit.circuit.Gate "qiskit.circuit.Gate"), `Reset`, `Barrier`, `Measure`, and operators such as [`Clifford`](qiskit.quantum_info.Clifford "qiskit.quantum_info.Clifford"). The main purpose is to add an [`Operation`](#qiskit.circuit.Operation "qiskit.circuit.Operation") to a [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") without synthesizing it before the transpilation. -## Example +**Example** Add a Clifford and a Toffoli gate to a QuantumCircuit. diff --git a/docs/api/qiskit/qiskit.circuit.Parameter.md b/docs/api/qiskit/qiskit.circuit.Parameter.md index bd6a980967c..063cf2da321 100644 --- a/docs/api/qiskit/qiskit.circuit.Parameter.md +++ b/docs/api/qiskit/qiskit.circuit.Parameter.md @@ -18,7 +18,7 @@ Parameter Class for variable parameters. A parameter is a variable value that is not required to be fixed at circuit definition. -## Examples +**Examples** Construct a variable-rotation X gate using circuit parameters. diff --git a/docs/api/qiskit/qiskit.circuit.QuantumCircuit.md b/docs/api/qiskit/qiskit.circuit.QuantumCircuit.md index 8f90cb7d2ff..685d19940dd 100644 --- a/docs/api/qiskit/qiskit.circuit.QuantumCircuit.md +++ b/docs/api/qiskit/qiskit.circuit.QuantumCircuit.md @@ -51,7 +51,7 @@ A circuit is a list of instructions bound to some registers. [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – if the circuit name, if given, is not valid. -## Examples +**Examples** Construct a simple Bell state circuit. @@ -227,7 +227,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. @@ -395,7 +395,7 @@ The values can be assigned to the current circuit object or to a copy of it. A copy of the circuit with bound parameters if `inplace` is False, otherwise None. -## Examples +**Examples** Create a parameterized circuit and assign the parameters in-place. @@ -721,7 +721,7 @@ the composed circuit (returns None if inplace==True). * [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – if trying to emit a new circuit while `self` has a partially built control-flow context active, such as the context-manager forms of [`if_test()`](#qiskit.circuit.QuantumCircuit.if_test "qiskit.circuit.QuantumCircuit.if_test"), [`for_loop()`](#qiskit.circuit.QuantumCircuit.for_loop "qiskit.circuit.QuantumCircuit.for_loop") and [`while_loop()`](#qiskit.circuit.QuantumCircuit.while_loop "qiskit.circuit.QuantumCircuit.while_loop"). * [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – if trying to compose to the front of a circuit when a control-flow builder block is active; there is no clear meaning to this action. -## Examples +**Examples** ```python >>> lhs.compose(rhs, qubits=[3, 2], inplace=True) @@ -1255,7 +1255,7 @@ Depth of circuit. [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)") -## Notes +**Notes** The circuit depth and the DAG depth need not be the same. @@ -1355,7 +1355,7 @@ Draw the quantum circuit. Use the output parameter to choose the drawing format: * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – when an invalid output method is selected * [**ImportError**](https://docs.python.org/3/library/exceptions.html#ImportError "(in Python v3.12)") – when the output methods requires non-installed libraries. -## Example +**Example** ```python from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit @@ -1414,7 +1414,7 @@ contains the index at which the `Bit` can be found (in either [`qubits`](#qiskit namedtuple([int](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)"), List\[Tuple([Register](qiskit.circuit.Register "qiskit.circuit.Register"), [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)"))]) -## Notes +**Notes** The circuit index of an [`AncillaQubit`](qiskit.circuit.AncillaQubit "qiskit.circuit.AncillaQubit") will be its index in [`qubits`](#qiskit.circuit.QuantumCircuit.qubits "qiskit.circuit.QuantumCircuit.qubits"), not [`ancillas`](#qiskit.circuit.QuantumCircuit.ancillas "qiskit.circuit.QuantumCircuit.ancillas"). @@ -1874,7 +1874,7 @@ Qubit initialization is done by first resetting the qubits to $|0\rangle$ follow A handle to the instructions created. -## Examples +**Examples** Prepare a qubit in the state $(|0\rangle - |1\rangle) / \sqrt{2}$. @@ -1959,7 +1959,7 @@ the inverted circuit [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – if the circuit cannot be inverted. -## Examples +**Examples** input: @@ -2265,7 +2265,7 @@ handle to the added instructions. [**CircuitError**](circuit#qiskit.circuit.CircuitError "qiskit.circuit.CircuitError") – if arguments have bad format. -## Examples +**Examples** In this example, a qubit is measured and the result of that measurement is stored in the classical bit (usually expressed in diagrams as a double line): @@ -2432,7 +2432,7 @@ Conditional nonlocal gates are also included. Computes the number of tensor factors in the unitary (quantum) part of the circuit only. -## Notes +**Notes** This is here for backwards compatibility, and will be removed in a future release of Qiskit. You should call num\_unitary\_factors instead. @@ -2561,7 +2561,7 @@ a handle to the instruction that was just initialized [qiskit.circuit.Instruction](qiskit.circuit.Instruction "qiskit.circuit.Instruction") -## Examples +**Examples** Prepare a qubit in the state $(|0\rangle - |1\rangle) / \sqrt{2}$. @@ -2907,7 +2907,7 @@ the circuit with reversed bit order. [QuantumCircuit](#qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") -## Examples +**Examples** input: @@ -2959,7 +2959,7 @@ the reversed circuit. [QuantumCircuit](#qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") -## Examples +**Examples** input: @@ -3498,7 +3498,7 @@ q_0: ┤ bottom ├ ⊗ q_0: ┤ top ├ = q_0: ─┤ top ├── [*QuantumCircuit*](#qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit") | None -## Examples +**Examples** ```python from qiskit import QuantumCircuit @@ -3770,7 +3770,7 @@ The quantum circuit. [QuantumCircuit](#qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") -## Example +**Example** Apply a gate specified by a unitary matrix to a quantum circuit diff --git a/docs/api/qiskit/qiskit.circuit.library.AND.md b/docs/api/qiskit/qiskit.circuit.library.AND.md index f7452f48003..3ff95ec8bdf 100644 --- a/docs/api/qiskit/qiskit.circuit.library.AND.md +++ b/docs/api/qiskit/qiskit.circuit.library.AND.md @@ -160,7 +160,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.C3SXGate.md b/docs/api/qiskit/qiskit.circuit.library.C3SXGate.md index 653c3282564..88aef8a9d43 100644 --- a/docs/api/qiskit/qiskit.circuit.library.C3SXGate.md +++ b/docs/api/qiskit/qiskit.circuit.library.C3SXGate.md @@ -18,7 +18,7 @@ The 3-qubit controlled sqrt-X gate. This implementation is based on Page 17 of \[1]. -## References +**References** \[1] Barenco et al., 1995. [https://arxiv.org/pdf/quant-ph/9503016.pdf](https://arxiv.org/pdf/quant-ph/9503016.pdf) diff --git a/docs/api/qiskit/qiskit.circuit.library.C4XGate.md b/docs/api/qiskit/qiskit.circuit.library.C4XGate.md index b33a91b53d7..c772d0c9d26 100644 --- a/docs/api/qiskit/qiskit.circuit.library.C4XGate.md +++ b/docs/api/qiskit/qiskit.circuit.library.C4XGate.md @@ -18,7 +18,7 @@ The 4-qubit controlled X gate. This implementation is based on Page 21, Lemma 7.5, of \[1], with the use of the relative phase version of c3x, the rc3x \[2]. -## References +**References** \[1] Barenco et al., 1995. [https://arxiv.org/pdf/quant-ph/9503016.pdf](https://arxiv.org/pdf/quant-ph/9503016.pdf) \[2] Maslov, 2015. [https://arxiv.org/abs/1508.03273](https://arxiv.org/abs/1508.03273) diff --git a/docs/api/qiskit/qiskit.circuit.library.CDKMRippleCarryAdder.md b/docs/api/qiskit/qiskit.circuit.library.CDKMRippleCarryAdder.md index e79837ca895..439257ea181 100644 --- a/docs/api/qiskit/qiskit.circuit.library.CDKMRippleCarryAdder.md +++ b/docs/api/qiskit/qiskit.circuit.library.CDKMRippleCarryAdder.md @@ -216,7 +216,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.Diagonal.md b/docs/api/qiskit/qiskit.circuit.library.Diagonal.md index f12cdb62154..63276c21f1d 100644 --- a/docs/api/qiskit/qiskit.circuit.library.Diagonal.md +++ b/docs/api/qiskit/qiskit.circuit.library.Diagonal.md @@ -188,7 +188,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.DraperQFTAdder.md b/docs/api/qiskit/qiskit.circuit.library.DraperQFTAdder.md index bb1e77e270e..0cac1f4e175 100644 --- a/docs/api/qiskit/qiskit.circuit.library.DraperQFTAdder.md +++ b/docs/api/qiskit/qiskit.circuit.library.DraperQFTAdder.md @@ -187,7 +187,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.EfficientSU2.md b/docs/api/qiskit/qiskit.circuit.library.EfficientSU2.md index a1e539338b1..0a082563402 100644 --- a/docs/api/qiskit/qiskit.circuit.library.EfficientSU2.md +++ b/docs/api/qiskit/qiskit.circuit.library.EfficientSU2.md @@ -34,7 +34,7 @@ On 3 qubits and using the Pauli $Y$ and $Z$ su2\_gates as single qubit gates, th See [`RealAmplitudes`](qiskit.circuit.library.RealAmplitudes "qiskit.circuit.library.RealAmplitudes") for more detail on the possible arguments and options such as skipping unentanglement qubits, which apply here too. -## Examples +**Examples** ```python >>> circuit = EfficientSU2(3, reps=1) @@ -267,7 +267,7 @@ The parameters used in the underlying circuit. This includes float values and duplicates. -## Examples +**Examples** ```python >>> # prepare circuit ... diff --git a/docs/api/qiskit/qiskit.circuit.library.EvolvedOperatorAnsatz.md b/docs/api/qiskit/qiskit.circuit.library.EvolvedOperatorAnsatz.md index 11f308d319e..b35160ece17 100644 --- a/docs/api/qiskit/qiskit.circuit.library.EvolvedOperatorAnsatz.md +++ b/docs/api/qiskit/qiskit.circuit.library.EvolvedOperatorAnsatz.md @@ -239,7 +239,7 @@ The parameters used in the underlying circuit. This includes float values and duplicates. -## Examples +**Examples** ```python >>> # prepare circuit ... diff --git a/docs/api/qiskit/qiskit.circuit.library.ExactReciprocal.md b/docs/api/qiskit/qiskit.circuit.library.ExactReciprocal.md index 4714ce497d6..db255724018 100644 --- a/docs/api/qiskit/qiskit.circuit.library.ExactReciprocal.md +++ b/docs/api/qiskit/qiskit.circuit.library.ExactReciprocal.md @@ -157,7 +157,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.ExcitationPreserving.md b/docs/api/qiskit/qiskit.circuit.library.ExcitationPreserving.md index 8997d4f7cf5..799c4c5eae8 100644 --- a/docs/api/qiskit/qiskit.circuit.library.ExcitationPreserving.md +++ b/docs/api/qiskit/qiskit.circuit.library.ExcitationPreserving.md @@ -39,7 +39,7 @@ See [`RealAmplitudes`](qiskit.circuit.library.RealAmplitudes "qiskit.circuit.lib The rotations of the ExcitationPreserving ansatz can be written as -## Examples +**Examples** ```python >>> ansatz = ExcitationPreserving(3, reps=1, insert_barriers=True, entanglement='linear') @@ -286,7 +286,7 @@ The parameters used in the underlying circuit. This includes float values and duplicates. -## Examples +**Examples** ```python >>> # prepare circuit ... diff --git a/docs/api/qiskit/qiskit.circuit.library.FourierChecking.md b/docs/api/qiskit/qiskit.circuit.library.FourierChecking.md index de9b4073a5e..dfcb04b201a 100644 --- a/docs/api/qiskit/qiskit.circuit.library.FourierChecking.md +++ b/docs/api/qiskit/qiskit.circuit.library.FourierChecking.md @@ -171,7 +171,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.GMS.md b/docs/api/qiskit/qiskit.circuit.library.GMS.md index 388ed76392c..9f271618c67 100644 --- a/docs/api/qiskit/qiskit.circuit.library.GMS.md +++ b/docs/api/qiskit/qiskit.circuit.library.GMS.md @@ -180,7 +180,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.GR.md b/docs/api/qiskit/qiskit.circuit.library.GR.md index ce076f998ff..93412aaa31a 100644 --- a/docs/api/qiskit/qiskit.circuit.library.GR.md +++ b/docs/api/qiskit/qiskit.circuit.library.GR.md @@ -174,7 +174,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.GRX.md b/docs/api/qiskit/qiskit.circuit.library.GRX.md index 2cf4dd9ad08..acf83080d71 100644 --- a/docs/api/qiskit/qiskit.circuit.library.GRX.md +++ b/docs/api/qiskit/qiskit.circuit.library.GRX.md @@ -173,7 +173,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.GRY.md b/docs/api/qiskit/qiskit.circuit.library.GRY.md index e09acda16f3..7dd67413423 100644 --- a/docs/api/qiskit/qiskit.circuit.library.GRY.md +++ b/docs/api/qiskit/qiskit.circuit.library.GRY.md @@ -173,7 +173,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.GRZ.md b/docs/api/qiskit/qiskit.circuit.library.GRZ.md index c3249d902f8..2816de651b2 100644 --- a/docs/api/qiskit/qiskit.circuit.library.GRZ.md +++ b/docs/api/qiskit/qiskit.circuit.library.GRZ.md @@ -173,7 +173,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.GraphState.md b/docs/api/qiskit/qiskit.circuit.library.GraphState.md index 43c502ffbd6..176f5cad79d 100644 --- a/docs/api/qiskit/qiskit.circuit.library.GraphState.md +++ b/docs/api/qiskit/qiskit.circuit.library.GraphState.md @@ -178,7 +178,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.GroverOperator.md b/docs/api/qiskit/qiskit.circuit.library.GroverOperator.md index 439f0780295..e6d71ba00ed 100644 --- a/docs/api/qiskit/qiskit.circuit.library.GroverOperator.md +++ b/docs/api/qiskit/qiskit.circuit.library.GroverOperator.md @@ -69,7 +69,7 @@ $$ where $\mathbb{I}_n$ is the identity on $n$ qubits. By default, this class implements the negative version $2 |0\rangle^{\otimes n} \langle 0|^{\otimes n} - \mathbb{I}_n$, since this can simply be implemented with a multi-controlled Z sandwiched by X gates on the target qubit and the introduced global phase does not matter for Grover’s algorithm. -## Examples +**Examples** ```python >>> from qiskit.circuit import QuantumCircuit @@ -139,7 +139,7 @@ state_2: ┤2 ├┤1 ├┤ UCRZ(-pi/4) ├┤ H « └─────────────────┘└───────────────┘└────────────┘└───┘ ``` -## References +**References** **\[1]: L. K. Grover (1996), A fast quantum mechanical algorithm for database search,** @@ -295,7 +295,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.HRSCumulativeMultiplier.md b/docs/api/qiskit/qiskit.circuit.library.HRSCumulativeMultiplier.md index db010906444..006e6223217 100644 --- a/docs/api/qiskit/qiskit.circuit.library.HRSCumulativeMultiplier.md +++ b/docs/api/qiskit/qiskit.circuit.library.HRSCumulativeMultiplier.md @@ -210,7 +210,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.HiddenLinearFunction.md b/docs/api/qiskit/qiskit.circuit.library.HiddenLinearFunction.md index 2f43281a84b..9c5b3efa749 100644 --- a/docs/api/qiskit/qiskit.circuit.library.HiddenLinearFunction.md +++ b/docs/api/qiskit/qiskit.circuit.library.HiddenLinearFunction.md @@ -180,7 +180,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.IQP.md b/docs/api/qiskit/qiskit.circuit.library.IQP.md index fbe96aa990c..481da8ce3e1 100644 --- a/docs/api/qiskit/qiskit.circuit.library.IQP.md +++ b/docs/api/qiskit/qiskit.circuit.library.IQP.md @@ -168,7 +168,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.InnerProduct.md b/docs/api/qiskit/qiskit.circuit.library.InnerProduct.md index eae2e78f3ce..5d09177d123 100644 --- a/docs/api/qiskit/qiskit.circuit.library.InnerProduct.md +++ b/docs/api/qiskit/qiskit.circuit.library.InnerProduct.md @@ -179,7 +179,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.LinearAmplitudeFunction.md b/docs/api/qiskit/qiskit.circuit.library.LinearAmplitudeFunction.md index 9d0cf8b4b39..270cd2c35d1 100644 --- a/docs/api/qiskit/qiskit.circuit.library.LinearAmplitudeFunction.md +++ b/docs/api/qiskit/qiskit.circuit.library.LinearAmplitudeFunction.md @@ -47,7 +47,7 @@ $$ where $1_{[a, b]}$ is an indication function that is 1 if the argument is in the interval $[a, b]$ and otherwise 0. The breakpoints $p_i$ can be specified by the `breakpoints` argument. -## References +**References** **\[1]: Woerner, S., & Egger, D. J. (2018).** @@ -194,7 +194,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.MCMT.md b/docs/api/qiskit/qiskit.circuit.library.MCMT.md index 9ec4142d01e..e1eb044a717 100644 --- a/docs/api/qiskit/qiskit.circuit.library.MCMT.md +++ b/docs/api/qiskit/qiskit.circuit.library.MCMT.md @@ -178,7 +178,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.MCMTVChain.md b/docs/api/qiskit/qiskit.circuit.library.MCMTVChain.md index 662241f8386..59529c03e87 100644 --- a/docs/api/qiskit/qiskit.circuit.library.MCMTVChain.md +++ b/docs/api/qiskit/qiskit.circuit.library.MCMTVChain.md @@ -202,7 +202,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.NLocal.md b/docs/api/qiskit/qiskit.circuit.library.NLocal.md index 7f8f294a04a..da8f856006b 100644 --- a/docs/api/qiskit/qiskit.circuit.library.NLocal.md +++ b/docs/api/qiskit/qiskit.circuit.library.NLocal.md @@ -253,7 +253,7 @@ The parameters used in the underlying circuit. This includes float values and duplicates. -## Examples +**Examples** ```python >>> # prepare circuit ... diff --git a/docs/api/qiskit/qiskit.circuit.library.OR.md b/docs/api/qiskit/qiskit.circuit.library.OR.md index 6d2faef0af8..0603771998c 100644 --- a/docs/api/qiskit/qiskit.circuit.library.OR.md +++ b/docs/api/qiskit/qiskit.circuit.library.OR.md @@ -160,7 +160,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.PauliFeatureMap.md b/docs/api/qiskit/qiskit.circuit.library.PauliFeatureMap.md index c2556efc90b..16a79464337 100644 --- a/docs/api/qiskit/qiskit.circuit.library.PauliFeatureMap.md +++ b/docs/api/qiskit/qiskit.circuit.library.PauliFeatureMap.md @@ -52,7 +52,7 @@ The circuit contains `reps` repetitions of this transformation. Please refer to [`ZFeatureMap`](qiskit.circuit.library.ZFeatureMap "qiskit.circuit.library.ZFeatureMap") for the case of single-qubit Pauli-$Z$ rotations and to [`ZZFeatureMap`](qiskit.circuit.library.ZZFeatureMap "qiskit.circuit.library.ZZFeatureMap") for the single- and two-qubit Pauli-$Z$ rotations. -## Examples +**Examples** ```python >>> prep = PauliFeatureMap(2, reps=1, paulis=['ZZ']) @@ -306,7 +306,7 @@ The parameters used in the underlying circuit. This includes float values and duplicates. -## Examples +**Examples** ```python >>> # prepare circuit ... diff --git a/docs/api/qiskit/qiskit.circuit.library.PauliTwoDesign.md b/docs/api/qiskit/qiskit.circuit.library.PauliTwoDesign.md index 1fd2664c114..be9fe55efdc 100644 --- a/docs/api/qiskit/qiskit.circuit.library.PauliTwoDesign.md +++ b/docs/api/qiskit/qiskit.circuit.library.PauliTwoDesign.md @@ -34,7 +34,7 @@ q_3: ┤ RY(π/4) ├┤ RZ(θ[3]) ├─■─────░─┤ RX(θ[7]) └─────────┘└──────────┘ ░ └──────────┘ ░ └───────────┘ ``` -## Examples +**Examples** ```python from qiskit.circuit.library import PauliTwoDesign @@ -44,7 +44,7 @@ circuit.draw('mpl') ![../\_images/qiskit-circuit-library-PauliTwoDesign-1.png](/images/api/qiskit/qiskit-circuit-library-PauliTwoDesign-1.png) -## References +**References** **\[1]: Nakata et al., Unitary 2-designs from random X- and Z-diagonal unitaries.** @@ -245,7 +245,7 @@ The parameters used in the underlying circuit. This includes float values and duplicates. -## Examples +**Examples** ```python >>> # prepare circuit ... diff --git a/docs/api/qiskit/qiskit.circuit.library.Permutation.md b/docs/api/qiskit/qiskit.circuit.library.Permutation.md index 7a8b49e3ade..1e3b896ce19 100644 --- a/docs/api/qiskit/qiskit.circuit.library.Permutation.md +++ b/docs/api/qiskit/qiskit.circuit.library.Permutation.md @@ -162,7 +162,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.PhaseEstimation.md b/docs/api/qiskit/qiskit.circuit.library.PhaseEstimation.md index dd41f42679a..2f85dc3882e 100644 --- a/docs/api/qiskit/qiskit.circuit.library.PhaseEstimation.md +++ b/docs/api/qiskit/qiskit.circuit.library.PhaseEstimation.md @@ -179,7 +179,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.PhaseOracle.md b/docs/api/qiskit/qiskit.circuit.library.PhaseOracle.md index fea1809c270..efbe9c39024 100644 --- a/docs/api/qiskit/qiskit.circuit.library.PhaseOracle.md +++ b/docs/api/qiskit/qiskit.circuit.library.PhaseOracle.md @@ -156,7 +156,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.PiecewiseChebyshev.md b/docs/api/qiskit/qiskit.circuit.library.PiecewiseChebyshev.md index 11f3b2c7a92..187fb36b280 100644 --- a/docs/api/qiskit/qiskit.circuit.library.PiecewiseChebyshev.md +++ b/docs/api/qiskit/qiskit.circuit.library.PiecewiseChebyshev.md @@ -20,7 +20,7 @@ For a given function $f(x)$ and degree $d$, this class implements a piecewise po The values of the parameters are calculated according to \[1] and see \[2] for a more detailed explanation of the circuit construction and how it acts on the qubits. -## Examples +**Examples** ```python import numpy as np @@ -37,7 +37,7 @@ qc.draw(output='mpl') ![../\_images/qiskit-circuit-library-PiecewiseChebyshev-1.png](/images/api/qiskit/qiskit-circuit-library-PiecewiseChebyshev-1.png) -## References +**References** **\[1]: Haener, T., Roetteler, M., & Svore, K. M. (2018).** diff --git a/docs/api/qiskit/qiskit.circuit.library.PiecewisePolynomialPauliRotations.md b/docs/api/qiskit/qiskit.circuit.library.PiecewisePolynomialPauliRotations.md index 6959dccbb8e..04f81ec2e53 100644 --- a/docs/api/qiskit/qiskit.circuit.library.PiecewisePolynomialPauliRotations.md +++ b/docs/api/qiskit/qiskit.circuit.library.PiecewisePolynomialPauliRotations.md @@ -33,7 +33,7 @@ where if given the same number of breakpoints as polynomials, we implicitly assu Note the $1/2$ factor in the coefficients of $f(x)$, this is consistent with Qiskit’s Pauli rotations. -## Examples +**Examples** ```python >>> from qiskit import QuantumCircuit @@ -62,7 +62,7 @@ q_5: ─────┤5 ├ └──────────┘ ``` -## References +**References** **\[1]: Haener, T., Roetteler, M., & Svore, K. M. (2018).** diff --git a/docs/api/qiskit/qiskit.circuit.library.QAOAAnsatz.md b/docs/api/qiskit/qiskit.circuit.library.QAOAAnsatz.md index 8d3b6a9ea9e..9aca9e1e909 100644 --- a/docs/api/qiskit/qiskit.circuit.library.QAOAAnsatz.md +++ b/docs/api/qiskit/qiskit.circuit.library.QAOAAnsatz.md @@ -16,7 +16,7 @@ Bases: [`EvolvedOperatorAnsatz`](qiskit.circuit.library.EvolvedOperatorAnsatz "q A generalized QAOA quantum circuit with a support of custom initial states and mixers. -## References +**References** **\[1]: Farhi et al., A Quantum Approximate Optimization Algorithm.** @@ -269,7 +269,7 @@ The parameters used in the underlying circuit. This includes float values and duplicates. -## Examples +**Examples** ```python >>> # prepare circuit ... diff --git a/docs/api/qiskit/qiskit.circuit.library.QuadraticForm.md b/docs/api/qiskit/qiskit.circuit.library.QuadraticForm.md index dc0618c675c..44c5e1f3b78 100644 --- a/docs/api/qiskit/qiskit.circuit.library.QuadraticForm.md +++ b/docs/api/qiskit/qiskit.circuit.library.QuadraticForm.md @@ -36,7 +36,7 @@ If the value of $Q(x)$ is too large to be represented with m qubits, the resulti The implementation of this circuit is discussed in \[1], Fig. 6. -## References +**References** **\[1]: Gilliam et al., Grover Adaptive Search for Constrained Polynomial Binary Optimization.** @@ -181,7 +181,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.QuantumVolume.md b/docs/api/qiskit/qiskit.circuit.library.QuantumVolume.md index 0ebf5950649..5d6c3afc730 100644 --- a/docs/api/qiskit/qiskit.circuit.library.QuantumVolume.md +++ b/docs/api/qiskit/qiskit.circuit.library.QuantumVolume.md @@ -167,7 +167,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.RGQFTMultiplier.md b/docs/api/qiskit/qiskit.circuit.library.RGQFTMultiplier.md index c1fa5648d3d..e8eb00db6a1 100644 --- a/docs/api/qiskit/qiskit.circuit.library.RGQFTMultiplier.md +++ b/docs/api/qiskit/qiskit.circuit.library.RGQFTMultiplier.md @@ -189,7 +189,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.RealAmplitudes.md b/docs/api/qiskit/qiskit.circuit.library.RealAmplitudes.md index a3698ff83be..5836a49165b 100644 --- a/docs/api/qiskit/qiskit.circuit.library.RealAmplitudes.md +++ b/docs/api/qiskit/qiskit.circuit.library.RealAmplitudes.md @@ -34,7 +34,7 @@ The entanglement can be set using the `entanglement` keyword as string or a list If some qubits are not entangled with other qubits it makes sense to not apply rotation gates on these qubits, since a sequence of $Y$ rotations can be reduced to a single $Y$ rotation with summed rotation angles. -## Examples +**Examples** ```python >>> ansatz = RealAmplitudes(3, reps=2) # create the circuit on 3 qubits @@ -305,7 +305,7 @@ The parameters used in the underlying circuit. This includes float values and duplicates. -## Examples +**Examples** ```python >>> # prepare circuit ... diff --git a/docs/api/qiskit/qiskit.circuit.library.TwoLocal.md b/docs/api/qiskit/qiskit.circuit.library.TwoLocal.md index e292912de3d..aa6a19615d9 100644 --- a/docs/api/qiskit/qiskit.circuit.library.TwoLocal.md +++ b/docs/api/qiskit/qiskit.circuit.library.TwoLocal.md @@ -43,7 +43,7 @@ Barriers can be inserted in between the different layers for better visualizatio For each parameterized gate a new parameter is generated using a `ParameterVector`. The name of these parameters can be chosen using the `parameter_prefix`. -## Examples +**Examples** ```python >>> two = TwoLocal(3, 'ry', 'cx', 'linear', reps=2, insert_barriers=True) @@ -317,7 +317,7 @@ The parameters used in the underlying circuit. This includes float values and duplicates. -## Examples +**Examples** ```python >>> # prepare circuit ... diff --git a/docs/api/qiskit/qiskit.circuit.library.UnitaryGate.md b/docs/api/qiskit/qiskit.circuit.library.UnitaryGate.md index b4597df2fef..9657c32d1c5 100644 --- a/docs/api/qiskit/qiskit.circuit.library.UnitaryGate.md +++ b/docs/api/qiskit/qiskit.circuit.library.UnitaryGate.md @@ -16,7 +16,7 @@ Bases: [`Gate`](qiskit.circuit.Gate "qiskit.circuit.gate.Gate") Class quantum gates specified by a unitary matrix. -## Example +**Example** We can create a unitary gate from a unitary matrix then add it to a quantum circuit. The matrix can also be directly applied to the quantum circuit, see [`QuantumCircuit.unitary()`](qiskit.circuit.QuantumCircuit#unitary "qiskit.circuit.QuantumCircuit.unitary"). diff --git a/docs/api/qiskit/qiskit.circuit.library.UnitaryOverlap.md b/docs/api/qiskit/qiskit.circuit.library.UnitaryOverlap.md index 95bfbf05bd9..ef1938733d3 100644 --- a/docs/api/qiskit/qiskit.circuit.library.UnitaryOverlap.md +++ b/docs/api/qiskit/qiskit.circuit.library.UnitaryOverlap.md @@ -189,7 +189,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.VBERippleCarryAdder.md b/docs/api/qiskit/qiskit.circuit.library.VBERippleCarryAdder.md index e96f665a1dd..61fd1da07b5 100644 --- a/docs/api/qiskit/qiskit.circuit.library.VBERippleCarryAdder.md +++ b/docs/api/qiskit/qiskit.circuit.library.VBERippleCarryAdder.md @@ -188,7 +188,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.XOR.md b/docs/api/qiskit/qiskit.circuit.library.XOR.md index 35d994de657..706b61405b3 100644 --- a/docs/api/qiskit/qiskit.circuit.library.XOR.md +++ b/docs/api/qiskit/qiskit.circuit.library.XOR.md @@ -162,7 +162,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.circuit.library.ZFeatureMap.md b/docs/api/qiskit/qiskit.circuit.library.ZFeatureMap.md index 505c9f21887..692905af5e8 100644 --- a/docs/api/qiskit/qiskit.circuit.library.ZFeatureMap.md +++ b/docs/api/qiskit/qiskit.circuit.library.ZFeatureMap.md @@ -30,7 +30,7 @@ On 3 qubits and with 2 repetitions the circuit is represented by: This is a sub-class of [`PauliFeatureMap`](qiskit.circuit.library.PauliFeatureMap "qiskit.circuit.library.PauliFeatureMap") where the Pauli strings are fixed as \[‘Z’]. As a result the first order expansion will be a circuit without entangling gates. -## Examples +**Examples** ```python >>> prep = ZFeatureMap(3, reps=3, insert_barriers=True) @@ -273,7 +273,7 @@ The parameters used in the underlying circuit. This includes float values and duplicates. -## Examples +**Examples** ```python >>> # prepare circuit ... diff --git a/docs/api/qiskit/qiskit.circuit.library.ZZFeatureMap.md b/docs/api/qiskit/qiskit.circuit.library.ZZFeatureMap.md index c10c42a9f89..9550f4d79ff 100644 --- a/docs/api/qiskit/qiskit.circuit.library.ZZFeatureMap.md +++ b/docs/api/qiskit/qiskit.circuit.library.ZZFeatureMap.md @@ -30,7 +30,7 @@ For 3 qubits and 1 repetition and linear entanglement the circuit is represented where $\varphi$ is a classical non-linear function, which defaults to $\varphi(x) = x$ if and $\varphi(x,y) = (\pi - x)(\pi - y)$. -## Examples +**Examples** ```python >>> from qiskit.circuit.library import ZZFeatureMap @@ -278,7 +278,7 @@ The parameters used in the underlying circuit. This includes float values and duplicates. -## Examples +**Examples** ```python >>> # prepare circuit ... diff --git a/docs/api/qiskit/qiskit.opflow.expectations.CVaRExpectation.md b/docs/api/qiskit/qiskit.opflow.expectations.CVaRExpectation.md index 9aa5799e634..5866c737c1c 100644 --- a/docs/api/qiskit/qiskit.opflow.expectations.CVaRExpectation.md +++ b/docs/api/qiskit/qiskit.opflow.expectations.CVaRExpectation.md @@ -24,7 +24,7 @@ It is empirically shown, that this can lead to faster convergence for combinator Let $\alpha$ be a real number in $[0,1]$ which specifies the fraction of best observed samples which are used to compute the objective function. Observe that if $\alpha = 1$, CVaR is equivalent to a standard expectation value. Similarly, if $\alpha = 0$, then CVaR corresponds to using the best observed sample. Intermediate values of $\alpha$ interpolate between these two objective functions. -## References +**References** **\[1]: Barkoutsos, P. K., Nannicini, G., Robert, A., Tavernelli, I., and Woerner, S.,** diff --git a/docs/api/qiskit/qiskit.opflow.list_ops.SummedOp.md b/docs/api/qiskit/qiskit.opflow.list_ops.SummedOp.md index 4d34fe26cd9..4bb226953ee 100644 --- a/docs/api/qiskit/qiskit.opflow.list_ops.SummedOp.md +++ b/docs/api/qiskit/qiskit.opflow.list_ops.SummedOp.md @@ -178,7 +178,7 @@ True, if other and self are equal, otherwise False. [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)") -## Examples +**Examples** ```python >>> from qiskit.opflow import X, Z diff --git a/docs/api/qiskit/qiskit.pulse.Schedule.md b/docs/api/qiskit/qiskit.pulse.Schedule.md index d4faac75e79..ce1250e1008 100644 --- a/docs/api/qiskit/qiskit.pulse.Schedule.md +++ b/docs/api/qiskit/qiskit.pulse.Schedule.md @@ -51,7 +51,7 @@ A [`PulseError`](pulse#qiskit.pulse.PulseError "qiskit.pulse.PulseError") is imm In the schedule representation, we cannot parametrize the duration of instructions. Thus we need to create a new schedule object for each duration. To parametrize an instruction’s duration, the [`ScheduleBlock`](qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") representation may be used instead. -## References +**References** \[1]: [https://arxiv.org/abs/2004.06755](https://arxiv.org/abs/2004.06755) @@ -81,7 +81,7 @@ Returns channels that this schedule uses. Return the child schedule components of this `Schedule` in the order they were added to the schedule. -## Notes +**Notes** Nested schedules are returned as-is. If you want to collect only instructions, use py:meth:\~Schedule.instructions instead. diff --git a/docs/api/qiskit/qiskit.pulse.ScheduleBlock.md b/docs/api/qiskit/qiskit.pulse.ScheduleBlock.md index 4e1c191335a..ad5f4e0b6de 100644 --- a/docs/api/qiskit/qiskit.pulse.ScheduleBlock.md +++ b/docs/api/qiskit/qiskit.pulse.ScheduleBlock.md @@ -18,29 +18,29 @@ Time-ordered sequence of instructions with alignment context. [`ScheduleBlock`](#qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") supports lazy scheduling of context instructions, i.e. their timeslots is always generated at runtime. This indicates we can parametrize instruction durations as well as other parameters. In contrast to [`Schedule`](qiskit.pulse.Schedule "qiskit.pulse.Schedule") being somewhat static, [`ScheduleBlock`](#qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") is a dynamic representation of a pulse program. -## Pulse Builder +**Pulse Builder** The Qiskit pulse builder is a domain specific language that is developed on top of the schedule block. Use of the builder syntax will improve the workflow of pulse programming. See [Pulse Builder](pulse#pulse-builder) for a user guide. -## Alignment contexts +**Alignment contexts** A schedule block is always relatively scheduled. Instead of taking individual instructions with absolute execution time `t0`, the schedule block defines a context of scheduling and instructions under the same context are scheduled in the same manner (alignment). Several contexts are available in [Alignments](pulse#pulse-alignments). A schedule block is instantiated with one of these alignment contexts. The default context is `AlignLeft`, for which all instructions are left-justified, in other words, meaning they use as-soon-as-possible scheduling. If you need an absolute-time interval in between instructions, you can explicitly insert [`Delay`](qiskit.pulse.instructions.Delay "qiskit.pulse.instructions.Delay") instructions. -## Nested blocks +**Nested blocks** A schedule block can contain other nested blocks with different alignment contexts. This enables advanced scheduling, where a subset of instructions is locally scheduled in a different manner. Note that a [`Schedule`](qiskit.pulse.Schedule "qiskit.pulse.Schedule") instance cannot be directly added to a schedule block. To add a [`Schedule`](qiskit.pulse.Schedule "qiskit.pulse.Schedule") instance, wrap it in a [`Call`](qiskit.pulse.instructions.Call "qiskit.pulse.instructions.Call") instruction. This is implicitly performed when a schedule is added through the [Pulse Builder](pulse#pulse-builder). -## Unsupported operations +**Unsupported operations** Because the schedule block representation lacks timeslots, it cannot perform particular [`Schedule`](qiskit.pulse.Schedule "qiskit.pulse.Schedule") operations such as `insert()` or `shift()` that require instruction start time `t0`. In addition, [`exclude()`](#qiskit.pulse.ScheduleBlock.exclude "qiskit.pulse.ScheduleBlock.exclude") and [`filter()`](#qiskit.pulse.ScheduleBlock.filter "qiskit.pulse.ScheduleBlock.filter") methods are not supported because these operations may identify the target instruction with `t0`. Except for these operations, [`ScheduleBlock`](#qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") provides full compatibility with [`Schedule`](qiskit.pulse.Schedule "qiskit.pulse.Schedule"). -## Subroutine +**Subroutine** The timeslots-free representation offers much greater flexibility for writing pulse programs. Because [`ScheduleBlock`](#qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") only cares about the ordering of the child blocks we can add an undefined pulse sequence as a subroutine of the main program. If your program contains the same sequence multiple times, this representation may reduce the memory footprint required by the program construction. Such a subroutine is realized by the special compiler directive [`Reference`](qiskit.pulse.instructions.Reference "qiskit.pulse.instructions.Reference") that is defined by a unique set of reference key strings to the subroutine. The (executable) subroutine is separately stored in the main program. Appended reference directives are resolved when the main program is executed. Subroutines must be assigned through [`assign_references()`](#qiskit.pulse.ScheduleBlock.assign_references "qiskit.pulse.ScheduleBlock.assign_references") before execution. -## Program Scoping +**Program Scoping** When you call a subroutine from another subroutine, or append a schedule block to another schedule block, the management of references and parameters can be a hard task. Schedule block offers a convenient feature to help with this by automatically scoping the parameters and subroutines. diff --git a/docs/api/qiskit/qiskit.pulse.instructions.Delay.md b/docs/api/qiskit/qiskit.pulse.instructions.Delay.md index 0be196930b2..47bd86f3602 100644 --- a/docs/api/qiskit/qiskit.pulse.instructions.Delay.md +++ b/docs/api/qiskit/qiskit.pulse.instructions.Delay.md @@ -16,7 +16,7 @@ Bases: [`Instruction`](pulse#qiskit.pulse.instructions.Instruction "qiskit.pulse A blocking instruction with no other effect. The delay is used for aligning and scheduling other instructions. -## Example +**Example** To schedule an instruction at time = 10, on a channel assigned to the variable `channel`, the following could be used: diff --git a/docs/api/qiskit/qiskit.pulse.instructions.TimeBlockade.md b/docs/api/qiskit/qiskit.pulse.instructions.TimeBlockade.md index d2bccabc9b7..288e410d494 100644 --- a/docs/api/qiskit/qiskit.pulse.instructions.TimeBlockade.md +++ b/docs/api/qiskit/qiskit.pulse.instructions.TimeBlockade.md @@ -18,7 +18,7 @@ Pulse `TimeBlockade` directive. This instruction is intended to be used internally within the pulse builder, to convert [`Schedule`](qiskit.pulse.Schedule "qiskit.pulse.Schedule") into [`ScheduleBlock`](qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock"). Because [`ScheduleBlock`](qiskit.pulse.ScheduleBlock "qiskit.pulse.ScheduleBlock") cannot take an absolute instruction time interval, this directive helps the block representation to find the starting time of an instruction. -## Example +**Example** This schedule plays constant pulse at t0 = 120. diff --git a/docs/api/qiskit/qiskit.pulse.library.Drag_class.rst.md b/docs/api/qiskit/qiskit.pulse.library.Drag_class.rst.md index 5d742a9b218..3ecb7b47c98 100644 --- a/docs/api/qiskit/qiskit.pulse.library.Drag_class.rst.md +++ b/docs/api/qiskit/qiskit.pulse.library.Drag_class.rst.md @@ -29,7 +29,7 @@ $$ where $g(x)$ is a standard unlifted Gaussian waveform, $g'(x)$ is the lifted [`Gaussian`](qiskit.pulse.library.Gaussian_class.rst#qiskit.pulse.library.Gaussian "qiskit.pulse.library.Gaussian") waveform, and $\text{A} = \text{amp} \times \exp\left(i\times\text{angle}\right)$. -## References +**References** 1. [*Gambetta, J. M., Motzoi, F., Merkel, S. T. & Wilhelm, F. K. Analytic control methods for high-fidelity unitary operations in a weakly nonlinear oscillator. Phys. Rev. A 83, 012308 (2011).*](https://link.aps.org/doi/10.1103/PhysRevA.83.012308) diff --git a/docs/api/qiskit/qiskit.pulse.library.SymbolicPulse.md b/docs/api/qiskit/qiskit.pulse.library.SymbolicPulse.md index 857d6779107..aa47831670a 100644 --- a/docs/api/qiskit/qiskit.pulse.library.SymbolicPulse.md +++ b/docs/api/qiskit/qiskit.pulse.library.SymbolicPulse.md @@ -20,7 +20,7 @@ A symbolic pulse instance can be defined with an envelope and parameter constrai The symbolic expressions must be defined either with [SymPy](https://www.sympy.org/en/index.html) or [Symengine](https://symengine.org). Usually Symengine-based expression is much more performant for instantiation of the [`SymbolicPulse`](#qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse"), however, it doesn’t support every functions available in SymPy. You may need to choose proper library depending on how you define your pulses. Symengine works in the most envelopes and constraints, and thus it is recommended to use this library especially when your program contains a lot of pulses. Also note that Symengine has the limited platform support and may not be available for your local system. Symengine is a required dependency for Qiskit on platforms that support it will always be installed along with Qiskit on macOS `x86_64` and `arm64`, and Linux `x86_64`, `aarch64`, and `ppc64le`. For 64-bit Windows users they will need to manual install it. For 32-bit platforms such as `i686` and `armv7` Linux, and on Linux `s390x` there are no pre-compiled packages available and to use symengine you’ll need to compile it from source. If Symengine is not available in your environment SymPy will be used. -## Envelope function +**Envelope function** The waveform at time $t$ is generated by the [`get_waveform()`](#qiskit.pulse.library.SymbolicPulse.get_waveform "qiskit.pulse.library.SymbolicPulse.get_waveform") according to @@ -30,15 +30,15 @@ $$ where $\Theta$ is the set of full pulse parameters in the [`SymbolicPulse.parameters`](#qiskit.pulse.library.SymbolicPulse.parameters "qiskit.pulse.library.SymbolicPulse.parameters") dictionary which must include the $\rm duration$. Note that the $F$ is an envelope of the waveform, and a programmer must provide this as a symbolic expression. $\overline{\rm params}$ can be arbitrary complex values as long as they pass [`validate_parameters()`](#qiskit.pulse.library.SymbolicPulse.validate_parameters "qiskit.pulse.library.SymbolicPulse.validate_parameters") and your quantum backend can accept. The time $t$ and $\rm duration$ are in units of dt, i.e. sample time resolution, and this function is sampled with a discrete time vector in $[0, {\rm duration}]$ sampling the pulse envelope at every 0.5 dt (middle sampling strategy) when the [`SymbolicPulse.get_waveform()`](#qiskit.pulse.library.SymbolicPulse.get_waveform "qiskit.pulse.library.SymbolicPulse.get_waveform") method is called. The sample data is not generated until this method is called thus a symbolic pulse instance only stores parameter values and waveform shape, which greatly reduces memory footprint during the program generation. -## Constraint functions +**Constraint functions** Constraints on the parameters are defined with an instance attribute [`SymbolicPulse.constraints`](#qiskit.pulse.library.SymbolicPulse.constraints "qiskit.pulse.library.SymbolicPulse.constraints") which can be provided through the constructor. The constraints value must be a symbolic expression, which is a function of parameters to be validated and must return a boolean value being `True` when parameters are valid. If there are multiple conditions to be evaluated, these conditions can be concatenated with logical expressions such as `And` and `Or` in SymPy or Symengine. The symbolic pulse instance can be played only when the constraint function returns `True`. The constraint is evaluated when [`validate_parameters()`](#qiskit.pulse.library.SymbolicPulse.validate_parameters "qiskit.pulse.library.SymbolicPulse.validate_parameters") is called. -## Maximum amplitude validation +**Maximum amplitude validation** When you play a pulse in a quantum backend, you might face the restriction on the power that your waveform generator can handle. Usually, the pulse amplitude is normalized by this maximum power, namely $\max |F| \leq 1$. This condition is evaluated along with above constraints when you set `limit_amplitude = True` in the constructor. To evaluate maximum amplitude of the waveform, we need to call [`get_waveform()`](#qiskit.pulse.library.SymbolicPulse.get_waveform "qiskit.pulse.library.SymbolicPulse.get_waveform"). However, this introduces a significant overhead in the validation, and this cannot be ignored when you repeatedly instantiate symbolic pulse instances. [`SymbolicPulse.valid_amp_conditions`](#qiskit.pulse.library.SymbolicPulse.valid_amp_conditions "qiskit.pulse.library.SymbolicPulse.valid_amp_conditions") provides a condition to skip this waveform validation, and the waveform is not generated as long as this condition returns `True`, so that healthy symbolic pulses are created very quick. For example, for a simple pulse shape like `amp * cos(f * t)`, we know that pulse amplitude is valid as long as `amp` remains less than magnitude 1.0. So `abs(amp) <= 1` could be passed as [`SymbolicPulse.valid_amp_conditions`](#qiskit.pulse.library.SymbolicPulse.valid_amp_conditions "qiskit.pulse.library.SymbolicPulse.valid_amp_conditions") to skip doing a full waveform evaluation for amplitude validation. This expression is provided through the constructor. If this is not provided, the waveform is generated everytime when [`validate_parameters()`](#qiskit.pulse.library.SymbolicPulse.validate_parameters "qiskit.pulse.library.SymbolicPulse.validate_parameters") is called. -## Examples +**Examples** This is how a user can instantiate a symbolic pulse instance. In this example, we instantiate a custom Sawtooth envelope. @@ -94,7 +94,7 @@ def Sawtooth(duration, amp, freq, name): You can also provide a `Parameter` object in the `parameters` dictionary, or define `duration` with a `Parameter` object when you instantiate the symbolic pulse instance. A waveform cannot be generated until you assign all unbounded parameters. Note that parameters will be assigned through the schedule playing the pulse. -## Serialization +**Serialization** The [`SymbolicPulse`](#qiskit.pulse.library.SymbolicPulse "qiskit.pulse.library.SymbolicPulse") subclass can be serialized along with the symbolic expressions through [`qiskit.qpy`](qpy#module-qiskit.qpy "qiskit.qpy"). A user can therefore create a custom pulse subclass with a novel envelope and constraints, and then one can instantiate the class with certain parameters to run on a backend. This pulse instance can be saved in the QPY binary, which can be loaded afterwards even within the environment not having original class definition loaded. This mechanism also allows us to easily share a pulse program including custom pulse instructions with collaborators. diff --git a/docs/api/qiskit/qiskit.pulse.library.gaussian_square_echo.md b/docs/api/qiskit/qiskit.pulse.library.gaussian_square_echo.md index 84132c9ed73..f52fd94f739 100644 --- a/docs/api/qiskit/qiskit.pulse.library.gaussian_square_echo.md +++ b/docs/api/qiskit/qiskit.pulse.library.gaussian_square_echo.md @@ -46,7 +46,7 @@ $$ $$ -## References +**References** 1. [*Jurcevic, P., Javadi-Abhari, A., Bishop, L. S., Lauer, I., Bogorin, D. F., Brink, M., Capelluto, L., G\{“u}nl\{“u}k, O., Itoko, T., Kanazawa, N. & others Demonstration of quantum volume 64 on a superconducting quantum computing system. (Section V)*](https://iopscience.iop.org/article/10.1088/2058-9565/abe519) diff --git a/docs/api/qiskit/qiskit.quantum_info.CNOTDihedral.md b/docs/api/qiskit/qiskit.quantum_info.CNOTDihedral.md index ed14d04adc5..dd14804ec99 100644 --- a/docs/api/qiskit/qiskit.quantum_info.CNOTDihedral.md +++ b/docs/api/qiskit/qiskit.quantum_info.CNOTDihedral.md @@ -318,7 +318,7 @@ a circuit implementation of the CNOTDihedral object. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") -## References +**References** 1. Shelly Garion and Andrew W. Cross, *Synthesis of CNOT-Dihedral circuits with optimal number of two qubit gates*, [Quantum 4(369), 2020](https://quantum-journal.org/papers/q-2020-12-07-369/) 2. Andrew W. Cross, Easwar Magesan, Lev S. Bishop, John A. Smolin and Jay M. Gambetta, *Scalable randomised benchmarking of non-Clifford gates*, npj Quantum Inf 2, 16012 (2016). diff --git a/docs/api/qiskit/qiskit.quantum_info.Chi.md b/docs/api/qiskit/qiskit.quantum_info.Chi.md index 3ac3b80e39e..91d32f8321c 100644 --- a/docs/api/qiskit/qiskit.quantum_info.Chi.md +++ b/docs/api/qiskit/qiskit.quantum_info.Chi.md @@ -26,7 +26,7 @@ where $[P_0, P_1, ..., P_{4^{n}-1}]$ is the $n$-qubit Pauli basis in lexicograph See reference \[1] for further details. -## References +**References** 1. C.J. Wood, J.D. Biamonte, D.G. Cory, *Tensor networks and graphical calculus for open quantum systems*, Quant. Inf. Comp. 15, 0579-0811 (2015). [arXiv:1111.6950 \[quant-ph\]](https://arxiv.org/abs/1111.6950) diff --git a/docs/api/qiskit/qiskit.quantum_info.Choi.md b/docs/api/qiskit/qiskit.quantum_info.Choi.md index 12d7bcafef9..363008ca819 100644 --- a/docs/api/qiskit/qiskit.quantum_info.Choi.md +++ b/docs/api/qiskit/qiskit.quantum_info.Choi.md @@ -34,7 +34,7 @@ where $\mbox{Tr}_1$ is the [`partial_trace()`](quantum_info#qiskit.quantum_info. See reference \[1] for further details. -## References +**References** 1. C.J. Wood, J.D. Biamonte, D.G. Cory, *Tensor networks and graphical calculus for open quantum systems*, Quant. Inf. Comp. 15, 0579-0811 (2015). [arXiv:1111.6950 \[quant-ph\]](https://arxiv.org/abs/1111.6950) diff --git a/docs/api/qiskit/qiskit.quantum_info.Clifford.md b/docs/api/qiskit/qiskit.quantum_info.Clifford.md index 237643452bc..1e07e94e3db 100644 --- a/docs/api/qiskit/qiskit.quantum_info.Clifford.md +++ b/docs/api/qiskit/qiskit.quantum_info.Clifford.md @@ -63,7 +63,7 @@ Clifford operators can be initialized from circuits containing *only* the follow Clifford operators can also be converted to [`Operator`](qiskit.quantum_info.Operator "qiskit.quantum_info.Operator") objects using the [`to_operator()`](#qiskit.quantum_info.Clifford.to_operator "qiskit.quantum_info.Clifford.to_operator") method. This is done via decomposing to a circuit, and then simulating the circuit as a unitary operator. -## References +**References** 1. S. Aaronson, D. Gottesman, *Improved Simulation of Stabilizer Circuits*, Phys. Rev. A 70, 052328 (2004). [arXiv:quant-ph/0406196](https://arxiv.org/abs/quant-ph/0406196) @@ -572,7 +572,7 @@ a circuit implementation of the Clifford. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") -## References +**References** 1. S. Bravyi, D. Maslov, *Hadamard-free circuits expose the structure of the Clifford group*, [arXiv:2003.09412 \[quant-ph\]](https://arxiv.org/abs/2003.09412) 2. S. Aaronson, D. Gottesman, *Improved Simulation of Stabilizer Circuits*, Phys. Rev. A 70, 052328 (2004). [arXiv:quant-ph/0406196](https://arxiv.org/abs/quant-ph/0406196) diff --git a/docs/api/qiskit/qiskit.quantum_info.DensityMatrix.md b/docs/api/qiskit/qiskit.quantum_info.DensityMatrix.md index 892da03ebb2..7c833af38dc 100644 --- a/docs/api/qiskit/qiskit.quantum_info.DensityMatrix.md +++ b/docs/api/qiskit/qiskit.quantum_info.DensityMatrix.md @@ -365,7 +365,7 @@ The Numpy vector array of probabilities. np.array -## Examples +**Examples** Consider a 2-qubit product state $\rho=\rho_1\otimes\rho_0$ with $\rho_1=|+\rangle\!\langle+|$, $\rho_0=|0\rangle\!\langle0|$. @@ -598,7 +598,7 @@ the dictionary form of the DensityMatrix. [dict](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.12)") -## Examples +**Examples** The ket-form of a 2-qubit density matrix $rho = |-\rangle\!\langle -|\otimes |0\rangle\!\langle 0|$ diff --git a/docs/api/qiskit/qiskit.quantum_info.Kraus.md b/docs/api/qiskit/qiskit.quantum_info.Kraus.md index 6efb1f5fdce..c67358470ed 100644 --- a/docs/api/qiskit/qiskit.quantum_info.Kraus.md +++ b/docs/api/qiskit/qiskit.quantum_info.Kraus.md @@ -30,7 +30,7 @@ $$ See reference \[1] for further details. -## References +**References** 1. C.J. Wood, J.D. Biamonte, D.G. Cory, *Tensor networks and graphical calculus for open quantum systems*, Quant. Inf. Comp. 15, 0579-0811 (2015). [arXiv:1111.6950 \[quant-ph\]](https://arxiv.org/abs/1111.6950) diff --git a/docs/api/qiskit/qiskit.quantum_info.PTM.md b/docs/api/qiskit/qiskit.quantum_info.PTM.md index 10b200b8c45..3dcb5ff8a35 100644 --- a/docs/api/qiskit/qiskit.quantum_info.PTM.md +++ b/docs/api/qiskit/qiskit.quantum_info.PTM.md @@ -34,7 +34,7 @@ where $|A\rangle\!\rangle_P$ denotes vectorization in the Pauli basis $\langle i See reference \[1] for further details. -## References +**References** 1. C.J. Wood, J.D. Biamonte, D.G. Cory, *Tensor networks and graphical calculus for open quantum systems*, Quant. Inf. Comp. 15, 0579-0811 (2015). [arXiv:1111.6950 \[quant-ph\]](https://arxiv.org/abs/1111.6950) diff --git a/docs/api/qiskit/qiskit.quantum_info.SparsePauliOp.md b/docs/api/qiskit/qiskit.quantum_info.SparsePauliOp.md index dcfb8abfecf..c072867030b 100644 --- a/docs/api/qiskit/qiskit.quantum_info.SparsePauliOp.md +++ b/docs/api/qiskit/qiskit.quantum_info.SparsePauliOp.md @@ -22,7 +22,7 @@ It can be used for performing operator arithmetic for hundred of qubits if the n The Pauli basis components are stored as a [`PauliList`](qiskit.quantum_info.PauliList "qiskit.quantum_info.PauliList") object and can be accessed using the [`paulis`](#qiskit.quantum_info.SparsePauliOp.paulis "qiskit.quantum_info.SparsePauliOp.paulis") attribute. The coefficients are stored as a complex Numpy array vector and can be accessed using the [`coeffs`](#qiskit.quantum_info.SparsePauliOp.coeffs "qiskit.quantum_info.SparsePauliOp.coeffs") attribute. -## Data type of coefficients +**Data type of coefficients** The default `dtype` of the internal `coeffs` Numpy array is `complex128`. Users can configure this by passing `np.ndarray` with a different dtype. For example, a parameterized [`SparsePauliOp`](#qiskit.quantum_info.SparsePauliOp "qiskit.quantum_info.SparsePauliOp") can be made as follows: diff --git a/docs/api/qiskit/qiskit.quantum_info.StabilizerState.md b/docs/api/qiskit/qiskit.quantum_info.StabilizerState.md index 4e99caaf35a..569a60619b1 100644 --- a/docs/api/qiskit/qiskit.quantum_info.StabilizerState.md +++ b/docs/api/qiskit/qiskit.quantum_info.StabilizerState.md @@ -42,7 +42,7 @@ StabilizerState(StabilizerTable: ['+XX', '+ZZ']) 1 ``` -## References +**References** 1. S. Aaronson, D. Gottesman, *Improved Simulation of Stabilizer Circuits*, Phys. Rev. A 70, 052328 (2004). [arXiv:quant-ph/0406196](https://arxiv.org/abs/quant-ph/0406196) diff --git a/docs/api/qiskit/qiskit.quantum_info.Statevector.md b/docs/api/qiskit/qiskit.quantum_info.Statevector.md index c7bfbaed815..d67e6d12ec6 100644 --- a/docs/api/qiskit/qiskit.quantum_info.Statevector.md +++ b/docs/api/qiskit/qiskit.quantum_info.Statevector.md @@ -141,7 +141,7 @@ Return a visualization of the Statevector. [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – when an invalid output method is selected. -## Examples +**Examples** Plot one of the Bell states @@ -420,7 +420,7 @@ The Numpy vector array of probabilities. np.array -## Examples +**Examples** Consider a 2-qubit product state $|\psi\rangle=|+\rangle\otimes|0\rangle$. @@ -657,7 +657,7 @@ the dictionary form of the Statevector. [dict](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.12)") -## Example +**Example** The ket-form of a 2-qubit statevector $|\psi\rangle = |-\rangle\otimes |0\rangle$ diff --git a/docs/api/qiskit/qiskit.quantum_info.Stinespring.md b/docs/api/qiskit/qiskit.quantum_info.Stinespring.md index 2a3b372d9e9..92035c97218 100644 --- a/docs/api/qiskit/qiskit.quantum_info.Stinespring.md +++ b/docs/api/qiskit/qiskit.quantum_info.Stinespring.md @@ -32,7 +32,7 @@ $$ See reference \[1] for further details. -## References +**References** 1. C.J. Wood, J.D. Biamonte, D.G. Cory, *Tensor networks and graphical calculus for open quantum systems*, Quant. Inf. Comp. 15, 0579-0811 (2015). [arXiv:1111.6950 \[quant-ph\]](https://arxiv.org/abs/1111.6950) diff --git a/docs/api/qiskit/qiskit.quantum_info.SuperOp.md b/docs/api/qiskit/qiskit.quantum_info.SuperOp.md index dddd03b16c3..c1fe079d9c4 100644 --- a/docs/api/qiskit/qiskit.quantum_info.SuperOp.md +++ b/docs/api/qiskit/qiskit.quantum_info.SuperOp.md @@ -26,7 +26,7 @@ where the double-ket notation $|A\rangle\!\rangle$ denotes a vector formed by st See reference \[1] for further details. -## References +**References** 1. C.J. Wood, J.D. Biamonte, D.G. Cory, *Tensor networks and graphical calculus for open quantum systems*, Quant. Inf. Comp. 15, 0579-0811 (2015). [arXiv:1111.6950 \[quant-ph\]](https://arxiv.org/abs/1111.6950) diff --git a/docs/api/qiskit/qiskit.quantum_info.Z2Symmetries.md b/docs/api/qiskit/qiskit.quantum_info.Z2Symmetries.md index 818f3579542..55d69421e32 100644 --- a/docs/api/qiskit/qiskit.quantum_info.Z2Symmetries.md +++ b/docs/api/qiskit/qiskit.quantum_info.Z2Symmetries.md @@ -38,7 +38,7 @@ The tolerance threshold for ignoring real and complex parts of a coefficient. [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)") -## References +**References** **\[1]: Bravyi, S., et al, “Tapering off qubits to simulate fermionic Hamiltonians”** diff --git a/docs/api/qiskit/qiskit.result.QuasiDistribution.md b/docs/api/qiskit/qiskit.result.QuasiDistribution.md index 82f33fce58f..212b2774037 100644 --- a/docs/api/qiskit/qiskit.result.QuasiDistribution.md +++ b/docs/api/qiskit/qiskit.result.QuasiDistribution.md @@ -151,7 +151,7 @@ Nearest probability distribution. float: Euclidean (L2) distance of distribution [ProbDistribution](qiskit.result.ProbDistribution "qiskit.result.ProbDistribution") -## Notes +**Notes** Method from Smolin et al., Phys. Rev. Lett. 108, 070502 (2012). diff --git a/docs/api/qiskit/qiskit.synthesis.LieTrotter.md b/docs/api/qiskit/qiskit.synthesis.LieTrotter.md index e5f9cd934ad..68db0b40f1b 100644 --- a/docs/api/qiskit/qiskit.synthesis.LieTrotter.md +++ b/docs/api/qiskit/qiskit.synthesis.LieTrotter.md @@ -28,7 +28,7 @@ $$ e^{-it(XX + ZZ)} = e^{-it XX}e^{-it ZZ} + \mathcal{O}(t^2). $$ -## References +**References** \[1]: D. Berry, G. Ahokas, R. Cleve and B. Sanders, “Efficient quantum algorithms for simulating sparse Hamiltonians” (2006). [arXiv:quant-ph/0508139](https://arxiv.org/abs/quant-ph/0508139) \[2]: N. Hatano and M. Suzuki, “Finding Exponential Product Formulas of Higher Orders” (2005). [arXiv:math-ph/0506007](https://arxiv.org/pdf/math-ph/0506007.pdf) diff --git a/docs/api/qiskit/qiskit.synthesis.QDrift.md b/docs/api/qiskit/qiskit.synthesis.QDrift.md index bad44fe4494..43d9aedf182 100644 --- a/docs/api/qiskit/qiskit.synthesis.QDrift.md +++ b/docs/api/qiskit/qiskit.synthesis.QDrift.md @@ -16,7 +16,7 @@ Bases: [`ProductFormula`](qiskit.synthesis.ProductFormula "qiskit.synthesis.evol The QDrift Trotterization method, which selects each each term in the Trotterization randomly, with a probability proportional to its weight. Based on the work of Earl Campbell in Ref. \[1]. -## References +**References** \[1]: E. Campbell, “A random compiler for fast Hamiltonian simulation” (2018). [arXiv:quant-ph/1811.08017](https://arxiv.org/abs/1811.08017) diff --git a/docs/api/qiskit/qiskit.synthesis.SuzukiTrotter.md b/docs/api/qiskit/qiskit.synthesis.SuzukiTrotter.md index d284322d7b7..b2edb9c7422 100644 --- a/docs/api/qiskit/qiskit.synthesis.SuzukiTrotter.md +++ b/docs/api/qiskit/qiskit.synthesis.SuzukiTrotter.md @@ -30,7 +30,7 @@ $$ e^{-it(XX + ZZ)} = e^{-it/2 ZZ}e^{-it XX}e^{-it/2 ZZ} + \mathcal{O}(t^3). $$ -## References +**References** \[1]: D. Berry, G. Ahokas, R. Cleve and B. Sanders, “Efficient quantum algorithms for simulating sparse Hamiltonians” (2006). [arXiv:quant-ph/0508139](https://arxiv.org/abs/quant-ph/0508139) \[2]: N. Hatano and M. Suzuki, “Finding Exponential Product Formulas of Higher Orders” (2005). [arXiv:math-ph/0506007](https://arxiv.org/pdf/math-ph/0506007.pdf) diff --git a/docs/api/qiskit/qiskit.transpiler.passes.AlignMeasures.md b/docs/api/qiskit/qiskit.transpiler.passes.AlignMeasures.md index dff9bb745cf..d438059488c 100644 --- a/docs/api/qiskit/qiskit.transpiler.passes.AlignMeasures.md +++ b/docs/api/qiskit/qiskit.transpiler.passes.AlignMeasures.md @@ -26,7 +26,7 @@ Measurement alignment is required if a backend only allows triggering `measure` In Qiskit SDK, the duration of delay can take arbitrary value in units of `dt`, thus circuits involving delays may violate the above alignment constraint (i.e. misalignment). This pass shifts measurement instructions to a new time position to fix the misalignment, by inserting extra delay right before the measure instructions. The input of this pass should be scheduled [`DAGCircuit`](qiskit.dagcircuit.DAGCircuit "qiskit.dagcircuit.DAGCircuit"), thus one should select one of the scheduling passes ([`ALAPSchedule`](qiskit.transpiler.passes.ALAPSchedule "qiskit.transpiler.passes.ALAPSchedule") or `ASAPSchedule`) before calling this. -## Examples +**Examples** We assume executing the following circuit on a backend with `alignment=16`. @@ -50,7 +50,7 @@ c: 1/════════════════════════╩ This pass always inserts a positive delay before measurements rather than reducing other delays. -## Notes +**Notes** The Backend may allow users to execute circuits violating the alignment constraint. However, it may return meaningless measurement data mainly due to the phase error. diff --git a/docs/api/qiskit/qiskit.transpiler.passes.ConsolidateBlocks.md b/docs/api/qiskit/qiskit.transpiler.passes.ConsolidateBlocks.md index 1c39752a451..e11626fba25 100644 --- a/docs/api/qiskit/qiskit.transpiler.passes.ConsolidateBlocks.md +++ b/docs/api/qiskit/qiskit.transpiler.passes.ConsolidateBlocks.md @@ -18,7 +18,7 @@ Replace each block of consecutive gates by a single Unitary node. Pass to consolidate sequences of uninterrupted gates acting on the same qubits into a Unitary node, to be resynthesized later, to a potentially more optimal subcircuit. -## Notes +**Notes** This pass assumes that the ‘blocks\_list’ property that it reads is given such that blocks are in topological order. The blocks are collected by a previous pass, such as Collect2qBlocks. diff --git a/docs/api/qiskit/qiskit.transpiler.passes.ConstrainedReschedule.md b/docs/api/qiskit/qiskit.transpiler.passes.ConstrainedReschedule.md index 7d1c9a76e07..14e44a74b94 100644 --- a/docs/api/qiskit/qiskit.transpiler.passes.ConstrainedReschedule.md +++ b/docs/api/qiskit/qiskit.transpiler.passes.ConstrainedReschedule.md @@ -18,7 +18,7 @@ Rescheduler pass that updates node start times to conform to the hardware alignm This pass shifts DAG node start times previously scheduled with one of the scheduling passes, e.g. [`ASAPScheduleAnalysis`](qiskit.transpiler.passes.ASAPScheduleAnalysis "qiskit.transpiler.passes.ASAPScheduleAnalysis") or [`ALAPScheduleAnalysis`](qiskit.transpiler.passes.ALAPScheduleAnalysis "qiskit.transpiler.passes.ALAPScheduleAnalysis"), so that every instruction start time satisfies alignment constraints. -## Examples +**Examples** We assume executing the following circuit on a backend with 16 dt of acquire alignment. @@ -40,7 +40,7 @@ c: 1/════════════════════════╩ 0 ``` -## Notes +**Notes** Your backend may execute circuits violating these alignment constraints. However, you may obtain erroneous measurement result because of the untracked phase originating in the instruction misalignment. diff --git a/docs/api/qiskit/qiskit.transpiler.passes.RemoveBarriers.md b/docs/api/qiskit/qiskit.transpiler.passes.RemoveBarriers.md index 175024c1c90..751d69ce6d2 100644 --- a/docs/api/qiskit/qiskit.transpiler.passes.RemoveBarriers.md +++ b/docs/api/qiskit/qiskit.transpiler.passes.RemoveBarriers.md @@ -18,7 +18,7 @@ Return a circuit with any barrier removed. This transformation is not semantics preserving. -## Example +**Example** ```python from qiskit import QuantumCircuit diff --git a/docs/api/qiskit/qiskit.transpiler.passes.SolovayKitaev.md b/docs/api/qiskit/qiskit.transpiler.passes.SolovayKitaev.md index 8ae1146a6c0..90692815309 100644 --- a/docs/api/qiskit/qiskit.transpiler.passes.SolovayKitaev.md +++ b/docs/api/qiskit/qiskit.transpiler.passes.SolovayKitaev.md @@ -39,7 +39,7 @@ q_0: ┤ H ├┤ T ├┤ H ├ with an L2-error of approximately 0.01. -## Examples +**Examples** Per default, the basis gate set is `["t", "tdg", "h"]`: @@ -90,7 +90,7 @@ approx = generate_basic_approximations(basis, depth=3) skd = SolovayKitaev(recursion_degree=2, basic_approximations=approx) ``` -## References +**References** **\[1]: Kitaev, A Yu (1997). Quantum computations: algorithms and error correction.** diff --git a/docs/api/qiskit/qiskit.transpiler.passes.StochasticSwap.md b/docs/api/qiskit/qiskit.transpiler.passes.StochasticSwap.md index 1ae519aa741..2e534f94677 100644 --- a/docs/api/qiskit/qiskit.transpiler.passes.StochasticSwap.md +++ b/docs/api/qiskit/qiskit.transpiler.passes.StochasticSwap.md @@ -18,7 +18,7 @@ Map a DAGCircuit onto a coupling\_map adding swap gates. Uses a randomized algorithm. -## Notes +**Notes** 1. Measurements may occur and be followed by swaps that result in repeated measurement of the same qubit. Near-term experiments cannot implement these circuits, so some care is required when using this mapper with experimental backend targets. 2. We do not use the fact that the input state is zero to simplify the circuit. diff --git a/docs/api/qiskit/qiskit.transpiler.passes.TranslateParameterizedGates.md b/docs/api/qiskit/qiskit.transpiler.passes.TranslateParameterizedGates.md index 39c5384b8fd..87b2e3a0e5e 100644 --- a/docs/api/qiskit/qiskit.transpiler.passes.TranslateParameterizedGates.md +++ b/docs/api/qiskit/qiskit.transpiler.passes.TranslateParameterizedGates.md @@ -18,7 +18,7 @@ Translate parameterized gates to a supported basis set. Once a parameterized instruction is found that is not in the `supported_gates` list, the instruction is decomposed one level and the parameterized sub-blocks are recursively decomposed. The recursion is stopped once all parameterized gates are in `supported_gates`, or if a gate has no definition and a translation to the basis is attempted (this might happen e.g. for the `UGate` if it’s not in the specified gate list). -## Example +**Example** The following, multiply nested circuit: diff --git a/docs/api/qiskit/qiskit.transpiler.synthesis.aqc.ApproximateCircuit.md b/docs/api/qiskit/qiskit.transpiler.synthesis.aqc.ApproximateCircuit.md index 6f46b343eca..eddf9758f71 100644 --- a/docs/api/qiskit/qiskit.transpiler.synthesis.aqc.ApproximateCircuit.md +++ b/docs/api/qiskit/qiskit.transpiler.synthesis.aqc.ApproximateCircuit.md @@ -147,7 +147,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.transpiler.synthesis.aqc.CNOTUnitCircuit.md b/docs/api/qiskit/qiskit.transpiler.synthesis.aqc.CNOTUnitCircuit.md index 4a14ed1d034..ca3edb203c4 100644 --- a/docs/api/qiskit/qiskit.transpiler.synthesis.aqc.CNOTUnitCircuit.md +++ b/docs/api/qiskit/qiskit.transpiler.synthesis.aqc.CNOTUnitCircuit.md @@ -153,7 +153,7 @@ The parameters defined in the circuit. This attribute returns the [`Parameter`](qiskit.circuit.Parameter "qiskit.circuit.Parameter") objects in the circuit sorted alphabetically. Note that parameters instantiated with a [`ParameterVector`](qiskit.circuit.ParameterVector "qiskit.circuit.ParameterVector") are still sorted numerically. -## Examples +**Examples** The snippet below shows that insertion order of parameters does not matter. diff --git a/docs/api/qiskit/qiskit.visualization.circuit_drawer.md b/docs/api/qiskit/qiskit.visualization.circuit_drawer.md index bc36a259ce1..7ebf78cbc73 100644 --- a/docs/api/qiskit/qiskit.visualization.circuit_drawer.md +++ b/docs/api/qiskit/qiskit.visualization.circuit_drawer.md @@ -74,7 +74,7 @@ Draw the quantum circuit. Use the output parameter to choose the drawing format: * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – when an invalid output method is selected * [**MissingOptionalLibraryError**](exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – when the output methods requires non-installed libraries. -## Example +**Example** ```python from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit diff --git a/docs/api/qiskit/qiskit.visualization.dag_drawer.md b/docs/api/qiskit/qiskit.visualization.dag_drawer.md index 3775cc53cd3..741619bfdb7 100644 --- a/docs/api/qiskit/qiskit.visualization.dag_drawer.md +++ b/docs/api/qiskit/qiskit.visualization.dag_drawer.md @@ -40,7 +40,7 @@ PIL.Image * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – when style is not recognized. * [**InvalidFileError**](exceptions#qiskit.exceptions.InvalidFileError "qiskit.exceptions.InvalidFileError") – when filename provided is not valid -## Example +**Example** ```python from qiskit import QuantumRegister, ClassicalRegister, QuantumCircuit diff --git a/docs/api/qiskit/qiskit.visualization.pass_manager_drawer.md b/docs/api/qiskit/qiskit.visualization.pass_manager_drawer.md index 8699659c48a..efe74b8f3d6 100644 --- a/docs/api/qiskit/qiskit.visualization.pass_manager_drawer.md +++ b/docs/api/qiskit/qiskit.visualization.pass_manager_drawer.md @@ -38,7 +38,7 @@ PIL.Image or None * [**MissingOptionalLibraryError**](exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – when nxpd or pydot not installed. * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – If raw=True and filename=None. -## Example +**Example** ```python %matplotlib inline diff --git a/docs/api/qiskit/qiskit.visualization.plot_bloch_multivector.md b/docs/api/qiskit/qiskit.visualization.plot_bloch_multivector.md index 39b18bfd40d..53084b0829a 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_bloch_multivector.md +++ b/docs/api/qiskit/qiskit.visualization.plot_bloch_multivector.md @@ -41,7 +41,7 @@ A matplotlib figure instance. * [**MissingOptionalLibraryError**](exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – Requires matplotlib. * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – if input is not a valid N-qubit state. -## Examples +**Examples** ```python from qiskit import QuantumCircuit diff --git a/docs/api/qiskit/qiskit.visualization.plot_bloch_vector.md b/docs/api/qiskit/qiskit.visualization.plot_bloch_vector.md index d9df3e6165f..4d807d800c1 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_bloch_vector.md +++ b/docs/api/qiskit/qiskit.visualization.plot_bloch_vector.md @@ -39,7 +39,7 @@ A matplotlib figure instance if `ax = None`. [**MissingOptionalLibraryError**](exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – Requires matplotlib. -## Examples +**Examples** ```python from qiskit.visualization import plot_bloch_vector diff --git a/docs/api/qiskit/qiskit.visualization.plot_circuit_layout.md b/docs/api/qiskit/qiskit.visualization.plot_circuit_layout.md index 44a87edcb5b..dee7c03f569 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_circuit_layout.md +++ b/docs/api/qiskit/qiskit.visualization.plot_circuit_layout.md @@ -36,7 +36,7 @@ Figure * [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – Invalid view type given. * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – Circuit has no layout attribute. -## Example +**Example** ```python import numpy as np diff --git a/docs/api/qiskit/qiskit.visualization.plot_coupling_map.md b/docs/api/qiskit/qiskit.visualization.plot_coupling_map.md index 6de9b2d6b8a..dd99fd380f3 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_coupling_map.md +++ b/docs/api/qiskit/qiskit.visualization.plot_coupling_map.md @@ -47,7 +47,7 @@ Figure * [**MissingOptionalLibraryError**](exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – If matplotlib or graphviz is not installed. * [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – If length of qubit labels does not match number of qubits. -## Example +**Example** ```python from qiskit.visualization import plot_coupling_map diff --git a/docs/api/qiskit/qiskit.visualization.plot_distribution.md b/docs/api/qiskit/qiskit.visualization.plot_distribution.md index 91ee393a38c..4dc1a50369d 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_distribution.md +++ b/docs/api/qiskit/qiskit.visualization.plot_distribution.md @@ -43,7 +43,7 @@ matplotlib.Figure * [**MissingOptionalLibraryError**](exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – Matplotlib not available. * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – When legend is provided and the length doesn’t match the input data. -## Examples +**Examples** ```python # Plot two counts in the same figure with legends and colors specified. diff --git a/docs/api/qiskit/qiskit.visualization.plot_error_map.md b/docs/api/qiskit/qiskit.visualization.plot_error_map.md index 8a94a2f00ee..895bff33318 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_error_map.md +++ b/docs/api/qiskit/qiskit.visualization.plot_error_map.md @@ -36,7 +36,7 @@ Figure * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – The backend does not provide gate errors for the ‘sx’ gate. * [**MissingOptionalLibraryError**](exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – If matplotlib or seaborn is not installed. -## Example +**Example** ```python from qiskit import QuantumCircuit, execute diff --git a/docs/api/qiskit/qiskit.visualization.plot_gate_map.md b/docs/api/qiskit/qiskit.visualization.plot_gate_map.md index 55ba1a9f979..8a3d09a72d8 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_gate_map.md +++ b/docs/api/qiskit/qiskit.visualization.plot_gate_map.md @@ -46,7 +46,7 @@ Figure * [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if tried to pass a simulator, or if the backend is None, but one of num\_qubits, mpl\_data, or cmap is None. * [**MissingOptionalLibraryError**](exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – if matplotlib not installed. -## Example +**Example** ```python from qiskit import QuantumCircuit, execute diff --git a/docs/api/qiskit/qiskit.visualization.plot_histogram.md b/docs/api/qiskit/qiskit.visualization.plot_histogram.md index bbc6be5251a..4eebb75452c 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_histogram.md +++ b/docs/api/qiskit/qiskit.visualization.plot_histogram.md @@ -48,7 +48,7 @@ matplotlib.Figure * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – When legend is provided and the length doesn’t match the input data. * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – Input must be Counts or a dict -## Examples +**Examples** ```python # Plot two counts in the same figure with legends and colors specified. diff --git a/docs/api/qiskit/qiskit.visualization.plot_state_city.md b/docs/api/qiskit/qiskit.visualization.plot_state_city.md index 75716084228..400ff9a2f20 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_state_city.md +++ b/docs/api/qiskit/qiskit.visualization.plot_state_city.md @@ -42,7 +42,7 @@ The matplotlib.Figure of the visualization if the `ax_real` and `ax_imag` kwargs * [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – When ‘color’ is not a list of len=2. * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – if input is not a valid N-qubit state. -## Examples +**Examples** ```python # You can choose different colors for the real and imaginary parts of the density matrix. diff --git a/docs/api/qiskit/qiskit.visualization.plot_state_hinton.md b/docs/api/qiskit/qiskit.visualization.plot_state_hinton.md index 3039665a104..87ec84010c0 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_state_hinton.md +++ b/docs/api/qiskit/qiskit.visualization.plot_state_hinton.md @@ -40,7 +40,7 @@ The matplotlib.Figure of the visualization if neither ax\_real or ax\_imag is se * [**MissingOptionalLibraryError**](exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – Requires matplotlib. * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – if input is not a valid N-qubit state. -## Examples +**Examples** ```python import numpy as np diff --git a/docs/api/qiskit/qiskit.visualization.plot_state_paulivec.md b/docs/api/qiskit/qiskit.visualization.plot_state_paulivec.md index 7eeafde31e4..c47483b1b13 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_state_paulivec.md +++ b/docs/api/qiskit/qiskit.visualization.plot_state_paulivec.md @@ -46,7 +46,7 @@ The matplotlib.Figure of the visualization if the `ax` kwarg is not set * [**MissingOptionalLibraryError**](exceptions#qiskit.exceptions.MissingOptionalLibraryError "qiskit.exceptions.MissingOptionalLibraryError") – Requires matplotlib. * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – if input is not a valid N-qubit state. -## Examples +**Examples** ```python # You can set a color for all the bars. diff --git a/docs/api/qiskit/qiskit.visualization.plot_state_qsphere.md b/docs/api/qiskit/qiskit.visualization.plot_state_qsphere.md index 26faec15180..5fa3c97f492 100644 --- a/docs/api/qiskit/qiskit.visualization.plot_state_qsphere.md +++ b/docs/api/qiskit/qiskit.visualization.plot_state_qsphere.md @@ -39,7 +39,7 @@ A matplotlib figure instance if the `ax` kwarg is not set * [**VisualizationError**](visualization#qiskit.visualization.VisualizationError "qiskit.visualization.VisualizationError") – if input is not a valid N-qubit state. * [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – Input statevector does not have valid dimensions. -## Examples +**Examples** ```python from qiskit import QuantumCircuit diff --git a/docs/api/qiskit/qiskit.visualization.pulse_drawer.md b/docs/api/qiskit/qiskit.visualization.pulse_drawer.md index 4302e1191a5..d92fdded985 100644 --- a/docs/api/qiskit/qiskit.visualization.pulse_drawer.md +++ b/docs/api/qiskit/qiskit.visualization.pulse_drawer.md @@ -240,7 +240,7 @@ The stylesheet kwarg contains numerous options that define the style of the outp * **layout.figure\_title** – Callback function that generates a string for the figure title. See `layout` for more details. No default layout is set. -## Examples +**Examples** To visualize a pulse program, you can call this function with set of control arguments. Most of appearance of the output image can be controlled by the stylesheet. diff --git a/docs/api/qiskit/qiskit.visualization.timeline_drawer.md b/docs/api/qiskit/qiskit.visualization.timeline_drawer.md index 696175a51a4..985adb63c0b 100644 --- a/docs/api/qiskit/qiskit.visualization.timeline_drawer.md +++ b/docs/api/qiskit/qiskit.visualization.timeline_drawer.md @@ -249,7 +249,7 @@ The stylesheet kwarg contains numerous options that define the style of the outp * **layout.time\_axis\_map** – Callback function that determines the layout of horizontal axis labels. See `layouts` for more details. No default layout is set. (default None). -## Examples +**Examples** To visualize a scheduled circuit program, you can call this function with set of control arguments. Most of appearance of the output image can be controlled by the stylesheet. diff --git a/docs/api/qiskit/qpy.md b/docs/api/qiskit/qpy.md index 5bcb9482ea9..7f722e95305 100644 --- a/docs/api/qiskit/qpy.md +++ b/docs/api/qiskit/qpy.md @@ -55,6 +55,8 @@ and then loading that file will return a list with all the circuits ### API documentation +### load + `qiskit.qpy.load(file_obj, metadata_deserializer=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/qpy/interface.py "view source code") @@ -100,6 +102,8 @@ The list of Qiskit programs contained in the QPY data. A list is always returned [*List*](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.12)")\[[*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit") | [*ScheduleBlock*](qiskit.pulse.ScheduleBlock "qiskit.pulse.schedule.ScheduleBlock")] +### dump + `qiskit.qpy.dump(programs, file_obj, metadata_serializer=None, use_symengine=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/qpy/interface.py "view source code") diff --git a/docs/api/qiskit/quantum_info.md b/docs/api/qiskit/quantum_info.md index 7cb10b88432..82f79e780db 100644 --- a/docs/api/qiskit/quantum_info.md +++ b/docs/api/qiskit/quantum_info.md @@ -56,6 +56,8 @@ python_api_name: qiskit.quantum_info ## Measures +### average\_gate\_fidelity + `qiskit.quantum_info.average_gate_fidelity(channel, target=None, require_cp=True, require_tp=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/measures.py "view source code") @@ -96,6 +98,8 @@ The average gate fidelity $F_{\text{ave}}$. [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if the channel and target do not have the same dimensions, or have different input and output dimensions. +### process\_fidelity + `qiskit.quantum_info.process_fidelity(channel, target=None, require_cp=True, require_tp=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/measures.py "view source code") @@ -143,6 +147,8 @@ The process fidelity $F_{\text{pro}}$. [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if the channel and target do not have the same dimensions. +### gate\_error + `qiskit.quantum_info.gate_error(channel, target=None, require_cp=True, require_tp=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/measures.py "view source code") @@ -178,6 +184,8 @@ The average gate error $E$. [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if the channel and target do not have the same dimensions, or have different input and output dimensions. +### diamond\_norm + `qiskit.quantum_info.diamond_norm(choi, solver='SCS', **kwargs)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/measures.py "view source code") @@ -216,6 +224,8 @@ J. Watrous. “Simpler semidefinite programs for completely bounded norms”, ar This function requires the optional CVXPY package to be installed. Any additional kwargs will be passed to the `cvxpy.solve` function. See the CVXPY documentation for information on available SDP solvers. +### state\_fidelity + `qiskit.quantum_info.state_fidelity(state1, state2, validate=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/states/measures.py "view source code") @@ -250,6 +260,8 @@ The state fidelity $F(\rho_1, \rho_2)$. [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if `validate=True` and the inputs are invalid quantum states. +### purity + `qiskit.quantum_info.purity(state, validate=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/states/measures.py "view source code") @@ -279,6 +291,8 @@ the purity $Tr[\rho^2]$. [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if the input isn’t a valid quantum state. +### concurrence + `qiskit.quantum_info.concurrence(state)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/states/measures.py "view source code") @@ -319,6 +333,8 @@ The concurrence. * [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if input is not a bipartite QuantumState. * [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if density matrix input is not a 2-qubit state. +### entropy + `qiskit.quantum_info.entropy(state, base=2)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/states/measures.py "view source code") @@ -348,6 +364,8 @@ The von-Neumann entropy S(rho). [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if the input state is not a valid QuantumState. +### entanglement\_of\_formation + `qiskit.quantum_info.entanglement_of_formation(state)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/states/measures.py "view source code") @@ -374,6 +392,8 @@ The entanglement of formation. * [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if input is not a bipartite QuantumState. * [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if density matrix input is not a 2-qubit state. +### mutual\_information + `qiskit.quantum_info.mutual_information(state, base=2)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/states/measures.py "view source code") @@ -408,6 +428,8 @@ The mutual information $I(\rho_{AB})$. ## Utility Functions +### partial\_trace + `qiskit.quantum_info.partial_trace(state, qargs)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/states/utils.py "view source code") @@ -433,6 +455,8 @@ The reduced density matrix. [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if input state is invalid. +### schmidt\_decomposition + `qiskit.quantum_info.schmidt_decomposition(state, qargs)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/states/utils.py "view source code") @@ -481,6 +505,8 @@ list of tuples `(s, u, v)`, where `s` (float) are the Schmidt coefficients $\lam In Qiskit, qubits are ordered using little-endian notation, with the least significant qubits having smaller indices. For example, a four-qubit system is represented as $|q_3q_2q_1q_0\rangle$. Using this convention, setting `qargs=[0]` will partition the state as $|q_3q_2q_1\rangle_A\otimes|q_0\rangle_B$. Furthermore, qubits will be organized in this notation regardless of the order they are passed. For instance, passing either `qargs=[1,2]` or `qargs=[2,1]` will result in partitioning the state as $|q_3q_0\rangle_A\otimes|q_2q_1\rangle_B$. +### shannon\_entropy + `qiskit.quantum_info.shannon_entropy(pvec, base=2)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/states/utils.py "view source code") @@ -508,6 +534,8 @@ The Shannon entropy H(pvec). [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)") +### commutator + `qiskit.quantum_info.commutator(a, b)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/utils/commutator.py "view source code") @@ -531,6 +559,8 @@ The commutator *OperatorTypeT* +### anti\_commutator + `qiskit.quantum_info.anti_commutator(a, b)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/utils/anti_commutator.py "view source code") @@ -554,6 +584,8 @@ The anti-commutator *OperatorTypeT* +### double\_commutator + `qiskit.quantum_info.double_commutator(a, b, c, *, commutator=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/utils/double_commutator.py "view source code") @@ -593,7 +625,7 @@ The double commutator *OperatorTypeT* -## References +**References** **\[1]: R. McWeeny.** @@ -601,6 +633,8 @@ Methods of Molecular Quantum Mechanics. 2nd Edition, Academic Press, 1992. ISBN ## Random +### random\_statevector + `qiskit.quantum_info.random_statevector(dims, seed=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/states/random.py "view source code") @@ -626,6 +660,8 @@ the random statevector. K. Zyczkowski and H. Sommers (2001), “Induced measures in the space of mixed quantum states”, [J. Phys. A: Math. Gen. 34 7111](https://arxiv.org/abs/quant-ph/0012101). +### random\_density\_matrix + `qiskit.quantum_info.random_density_matrix(dims, rank=None, method='Hilbert-Schmidt', seed=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/states/random.py "view source code") @@ -651,6 +687,8 @@ the random density matrix. [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if the method is not valid. +### random\_unitary + `qiskit.quantum_info.random_unitary(dims, seed=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/random.py "view source code") @@ -672,6 +710,8 @@ a unitary operator. [Operator](qiskit.quantum_info.Operator "qiskit.quantum_info.Operator") +### random\_hermitian + `qiskit.quantum_info.random_hermitian(dims, traceless=False, seed=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/random.py "view source code") @@ -694,6 +734,8 @@ a Hermitian operator. [Operator](qiskit.quantum_info.Operator "qiskit.quantum_info.Operator") +### random\_pauli + `qiskit.quantum_info.random_pauli(num_qubits, group_phase=False, seed=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/symplectic/random.py "view source code") @@ -714,6 +756,8 @@ a random Pauli [Pauli](qiskit.quantum_info.Pauli "qiskit.quantum_info.Pauli") +### random\_clifford + `qiskit.quantum_info.random_clifford(num_qubits, seed=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/symplectic/random.py "view source code") @@ -739,6 +783,8 @@ a random Clifford operator. 1. S. Bravyi and D. Maslov, *Hadamard-free circuits expose the structure of the Clifford group*. [arXiv:2003.09412 \[quant-ph\]](https://arxiv.org/abs/2003.09412) +### random\_quantum\_channel + `qiskit.quantum_info.random_quantum_channel(input_dims=None, output_dims=None, rank=None, seed=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/random.py "view source code") @@ -766,6 +812,8 @@ a quantum channel operator. [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if rank or dimensions are invalid. +### random\_cnotdihedral + `qiskit.quantum_info.random_cnotdihedral(num_qubits, seed=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/dihedral/random.py "view source code") @@ -785,6 +833,8 @@ a random CNOTDihedral element. [CNOTDihedral](qiskit.quantum_info.CNOTDihedral "qiskit.quantum_info.CNOTDihedral") +### random\_pauli\_list + `qiskit.quantum_info.random_pauli_list(num_qubits, size=1, seed=None, phase=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/operators/symplectic/random.py "view source code") @@ -808,6 +858,8 @@ a random PauliList. ## Analysis +### hellinger\_distance + `qiskit.quantum_info.hellinger_distance(dist_p, dist_q)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/analysis/distance.py "view source code") @@ -827,10 +879,12 @@ Distance [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)") -## References +**References** [Hellinger Distance @ wikipedia](https://en.wikipedia.org/wiki/Hellinger_distance) +### hellinger\_fidelity + `qiskit.quantum_info.hellinger_fidelity(dist_p, dist_q)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/analysis/distance.py "view source code") @@ -854,7 +908,7 @@ Fidelity [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)") -## Example +**Example** ```python from qiskit import QuantumCircuit, execute, BasicAer @@ -875,7 +929,7 @@ res2 = execute(qc, sim).result() hellinger_fidelity(res1.get_counts(), res2.get_counts()) ``` -## References +**References** [Quantum Fidelity @ wikipedia](https://en.wikipedia.org/wiki/Fidelity_of_quantum_states) [Hellinger Distance @ wikipedia](https://en.wikipedia.org/wiki/Hellinger_distance) @@ -892,6 +946,8 @@ hellinger_fidelity(res1.get_counts(), res2.get_counts()) | [`Quaternion`](qiskit.quantum_info.Quaternion "qiskit.quantum_info.Quaternion")(data) | A class representing a Quaternion. | | [`XXDecomposer`](qiskit.quantum_info.XXDecomposer "qiskit.quantum_info.XXDecomposer")(\[basis\_fidelity, euler\_basis, ...]) | A class for optimal decomposition of 2-qubit unitaries into 2-qubit basis gates of XX type (i.e., each locally equivalent to CAN(alpha, 0, 0) for a possibly varying alpha). | +### two\_qubit\_cnot\_decompose + `qiskit.quantum_info.two_qubit_cnot_decompose(*args, **kwargs)` @@ -900,6 +956,8 @@ hellinger_fidelity(res1.get_counts(), res2.get_counts()) [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### decompose\_clifford + `qiskit.quantum_info.decompose_clifford(clifford, method=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/quantum_info/synthesis/clifford_decompose.py "view source code") @@ -925,7 +983,7 @@ a circuit implementation of the Clifford. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") -## References +**References** 1. S. Bravyi, D. Maslov, *Hadamard-free circuits expose the structure of the Clifford group*, [arXiv:2003.09412 \[quant-ph\]](https://arxiv.org/abs/2003.09412) 2. S. Aaronson, D. Gottesman, *Improved Simulation of Stabilizer Circuits*, Phys. Rev. A 70, 052328 (2004). [arXiv:quant-ph/0406196](https://arxiv.org/abs/quant-ph/0406196) diff --git a/docs/api/qiskit/result.md b/docs/api/qiskit/result.md index 94e13914104..e400af7e09f 100644 --- a/docs/api/qiskit/result.md +++ b/docs/api/qiskit/result.md @@ -24,6 +24,8 @@ python_api_name: qiskit.result | [`ResultError`](qiskit.result.ResultError "qiskit.result.ResultError")(error) | Exceptions raised due to errors in result output. | | [`Counts`](qiskit.result.Counts "qiskit.result.Counts")(data\[, time\_taken, creg\_sizes, ...]) | A class to store a counts result from a circuit execution. | +### marginal\_counts + `qiskit.result.marginal_counts(result, indices=None, inplace=False, format_marginal=False, marginalize_memory=True)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/result/utils.py "view source code") @@ -52,6 +54,8 @@ the observed counts, marginalized to only account for frequency of observations [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – in case of invalid indices to marginalize over. +### marginal\_distribution + `qiskit.result.marginal_distribution(counts, indices=None, format_marginal=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/result/utils.py "view source code") @@ -79,6 +83,8 @@ A marginalized dictionary * [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – If any value in `indices` is invalid or the `counts` dict * **is invalid.** – +### marginal\_memory + `qiskit.result.marginal_memory(memory, indices=None, int_return=False, hex_return=False, avg_data=False, parallel_threshold=1000)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/result/utils.py "view source code") @@ -117,6 +123,8 @@ marginal\_memory ## Expectation values +### sampled\_expectation\_value + `qiskit.result.sampled_expectation_value(dist, oper)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/result/sampled_expval.py "view source code") diff --git a/docs/api/qiskit/scheduler.md b/docs/api/qiskit/scheduler.md index 1ac9729171d..3cab339ba4a 100644 --- a/docs/api/qiskit/scheduler.md +++ b/docs/api/qiskit/scheduler.md @@ -34,6 +34,8 @@ Container for information needed to schedule a QuantumCircuit into a pulse Sched * **meas\_map** ([*List*](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.12)")*\[*[*List*](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.12)")*\[*[*int*](https://docs.python.org/3/library/functions.html#int "(in Python v3.12)")*]]*) – A list of groups of qubits which have to be measured together. * **dt** ([*float*](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)")) – Sample duration. +### schedule\_circuit + `qiskit.scheduler.schedule_circuit.schedule_circuit(circuit, schedule_config, method=None, backend=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/scheduler/schedule_circuit.py "view source code") @@ -68,6 +70,8 @@ Schedule corresponding to the input circuit. Pulse scheduling methods. +### as\_soon\_as\_possible + `qiskit.scheduler.methods.as_soon_as_possible(circuit, schedule_config, backend=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/scheduler/methods/basic.py "view source code") @@ -90,6 +94,8 @@ A schedule corresponding to the input `circuit` with pulses occurring as early a [*Schedule*](qiskit.pulse.Schedule "qiskit.pulse.schedule.Schedule") +### as\_late\_as\_possible + `qiskit.scheduler.methods.as_late_as_possible(circuit, schedule_config, backend=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/scheduler/methods/basic.py "view source code") diff --git a/docs/api/qiskit/synthesis.md b/docs/api/qiskit/synthesis.md index 16a568d4c77..da051539689 100644 --- a/docs/api/qiskit/synthesis.md +++ b/docs/api/qiskit/synthesis.md @@ -33,6 +33,8 @@ python_api_name: qiskit.synthesis ## Linear Function Synthesis +### synth\_cnot\_count\_full\_pmh + `qiskit.synthesis.synth_cnot_count_full_pmh(state, section_size=2)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/linear/cnot_synth.py "view source code") @@ -58,10 +60,12 @@ a CX-only circuit implementing the linear transformation. [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – when variable “state” isn’t of type numpy.ndarray -## References +**References** 1. Patel, Ketan N., Igor L. Markov, and John P. Hayes, *Optimal synthesis of linear reversible circuits*, Quantum Information & Computation 8.3 (2008): 282-294. [arXiv:quant-ph/0302002 \[quant-ph\]](https://arxiv.org/abs/quant-ph/0302002) +### synth\_cnot\_depth\_line\_kms + `qiskit.synthesis.synth_cnot_depth_line_kms(mat)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/linear/linear_depth_lnn.py "view source code") @@ -86,12 +90,14 @@ the synthesized quantum circuit. [**QiskitError**](exceptions#qiskit.exceptions.QiskitError "qiskit.exceptions.QiskitError") – if mat is not invertible. -## References +**References** 1. Kutin, S., Moulton, D. P., Smithline, L., *Computation at a distance*, Chicago J. Theor. Comput. Sci., vol. 2007, (2007), [arXiv:quant-ph/0701194](https://arxiv.org/abs/quant-ph/0701194) ## Linear-Phase Synthesis +### synth\_cz\_depth\_line\_mr + `qiskit.synthesis.synth_cz_depth_line_mr(mat)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/linear_phase/cz_depth_lnn.py "view source code") @@ -116,6 +122,8 @@ a circuit implementation of the CZ circuit of depth 2\*n+2 for LNN connectivity. 1. Dmitri Maslov, Martin Roetteler, *Shorter stabilizer circuits via Bruhat decomposition and quantum circuit transformations*, [arXiv:1705.09176](https://arxiv.org/abs/1705.09176). +### synth\_cx\_cz\_depth\_line\_my + `qiskit.synthesis.synth_cx_cz_depth_line_my(mat_x, mat_z)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/linear_phase/cx_cz_depth_lnn.py "view source code") @@ -142,6 +150,8 @@ a circuit implementation of a CX circuit following a CZ circuit, denoted as a -C ## Permutation Synthesis +### synth\_permutation\_depth\_lnn\_kms + `qiskit.synthesis.synth_permutation_depth_lnn_kms(pattern)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/permutation/permutation_lnn.py "view source code") @@ -162,6 +172,8 @@ the synthesized quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### synth\_permutation\_basic + `qiskit.synthesis.synth_permutation_basic(pattern)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/permutation/permutation_full.py "view source code") @@ -182,6 +194,8 @@ the synthesized quantum circuit. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") +### synth\_permutation\_acg + `qiskit.synthesis.synth_permutation_acg(pattern)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/permutation/permutation_full.py "view source code") @@ -206,6 +220,8 @@ the synthesized quantum circuit. ## Clifford Synthesis +### synth\_clifford\_full + `qiskit.synthesis.synth_clifford_full(clifford, method=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/clifford/clifford_decompose_full.py "view source code") @@ -227,12 +243,14 @@ a circuit implementation of the Clifford. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") -## References +**References** 1. S. Bravyi, D. Maslov, *Hadamard-free circuits expose the structure of the Clifford group*, [arXiv:2003.09412 \[quant-ph\]](https://arxiv.org/abs/2003.09412) 2. S. Aaronson, D. Gottesman, *Improved Simulation of Stabilizer Circuits*, Phys. Rev. A 70, 052328 (2004). [arXiv:quant-ph/0406196](https://arxiv.org/abs/quant-ph/0406196) 3. Sergey Bravyi, Shaohan Hu, Dmitri Maslov, Ruslan Shaydulin, *Clifford Circuit Optimization with Templates and Symbolic Pauli Gates*, [arXiv:2105.02291 \[quant-ph\]](https://arxiv.org/abs/2105.02291) +### synth\_clifford\_ag + `qiskit.synthesis.synth_clifford_ag(clifford)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/clifford/clifford_decompose_ag.py "view source code") @@ -255,6 +273,8 @@ a circuit implementation of the Clifford. 1. S. Aaronson, D. Gottesman, *Improved Simulation of Stabilizer Circuits*, Phys. Rev. A 70, 052328 (2004). [arXiv:quant-ph/0406196](https://arxiv.org/abs/quant-ph/0406196) +### synth\_clifford\_bm + `qiskit.synthesis.synth_clifford_bm(clifford)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/clifford/clifford_decompose_bm.py "view source code") @@ -281,6 +301,8 @@ a circuit implementation of the Clifford. 1. S. Bravyi, D. Maslov, *Hadamard-free circuits expose the structure of the Clifford group*, [arXiv:2003.09412 \[quant-ph\]](https://arxiv.org/abs/2003.09412) +### synth\_clifford\_greedy + `qiskit.synthesis.synth_clifford_greedy(clifford)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/clifford/clifford_decompose_greedy.py "view source code") @@ -309,6 +331,8 @@ a circuit implementation of the Clifford. 1. Sergey Bravyi, Shaohan Hu, Dmitri Maslov, Ruslan Shaydulin, *Clifford Circuit Optimization with Templates and Symbolic Pauli Gates*, [arXiv:2105.02291 \[quant-ph\]](https://arxiv.org/abs/2105.02291) +### synth\_clifford\_layers + `qiskit.synthesis.synth_clifford_layers(cliff, cx_synth_func=, cz_synth_func=, cx_cz_synth_func=None, cz_func_reverse_qubits=False, validate=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/clifford/clifford_decompose_layers.py "view source code") @@ -354,6 +378,8 @@ a circuit implementation of the Clifford. 1. S. Bravyi, D. Maslov, *Hadamard-free circuits expose the structure of the Clifford group*, [arXiv:2003.09412 \[quant-ph\]](https://arxiv.org/abs/2003.09412) +### synth\_clifford\_depth\_lnn + `qiskit.synthesis.synth_clifford_depth_lnn(cliff)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/clifford/clifford_decompose_layers.py "view source code") @@ -382,6 +408,8 @@ a circuit implementation of the Clifford. ## CNOTDihedral Synthesis +### synth\_cnotdihedral\_full + `qiskit.synthesis.synth_cnotdihedral_full(elem)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/cnotdihedral/cnotdihedral_decompose_full.py "view source code") @@ -400,11 +428,13 @@ a circuit implementation of the CNOTDihedral element. [QuantumCircuit](qiskit.circuit.QuantumCircuit "qiskit.circuit.QuantumCircuit") -## References +**References** 1. Shelly Garion and Andrew W. Cross, *Synthesis of CNOT-Dihedral circuits with optimal number of two qubit gates*, [Quantum 4(369), 2020](https://quantum-journal.org/papers/q-2020-12-07-369/) 2. Andrew W. Cross, Easwar Magesan, Lev S. Bishop, John A. Smolin and Jay M. Gambetta, *Scalable randomised benchmarking of non-Clifford gates*, npj Quantum Inf 2, 16012 (2016). +### synth\_cnotdihedral\_two\_qubits + `qiskit.synthesis.synth_cnotdihedral_two_qubits(elem)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/cnotdihedral/cnotdihedral_decompose_two_qubits.py "view source code") @@ -431,6 +461,8 @@ a circuit implementation of the CNOTDihedral element. 1. Shelly Garion and Andrew W. Cross, *On the structure of the CNOT-Dihedral group*, [arXiv:2006.12042 \[quant-ph\]](https://arxiv.org/abs/2006.12042) +### synth\_cnotdihedral\_general + `qiskit.synthesis.synth_cnotdihedral_general(elem)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/cnotdihedral/cnotdihedral_decompose_general.py "view source code") @@ -461,6 +493,8 @@ a circuit implementation of the CNOTDihedral element. ## Stabilizer State Synthesis +### synth\_stabilizer\_layers + `qiskit.synthesis.synth_stabilizer_layers(stab, cz_synth_func=, cz_func_reverse_qubits=False, validate=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/stabilizer/stabilizer_decompose.py "view source code") @@ -508,6 +542,8 @@ a circuit implementation of the stabilizer state. 1. S. Bravyi, D. Maslov, *Hadamard-free circuits expose the structure of the Clifford group*, [arXiv:2003.09412 \[quant-ph\]](https://arxiv.org/abs/2003.09412) +### synth\_stabilizer\_depth\_lnn + `qiskit.synthesis.synth_stabilizer_depth_lnn(stab)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/stabilizer/stabilizer_decompose.py "view source code") @@ -537,6 +573,8 @@ a circuit implementation of the stabilizer state. | --------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- | | [`SolovayKitaevDecomposition`](qiskit.synthesis.SolovayKitaevDecomposition "qiskit.synthesis.SolovayKitaevDecomposition")(\[...]) | The Solovay Kitaev discrete decomposition algorithm. | +### generate\_basic\_approximations + `qiskit.synthesis.generate_basic_approximations(basis_gates, depth, filename=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/synthesis/discrete_basis/generate_basis_approximations.py "view source code") diff --git a/docs/api/qiskit/synthesis_aqc.md b/docs/api/qiskit/synthesis_aqc.md index 2154aa27bc4..450ea9ad79b 100644 --- a/docs/api/qiskit/synthesis_aqc.md +++ b/docs/api/qiskit/synthesis_aqc.md @@ -126,6 +126,8 @@ Now `approximate_circuit` is a circuit that approximates the target unitary to a This uses a helper function, [`make_cnot_network`](#qiskit.transpiler.synthesis.aqc.make_cnot_network "qiskit.transpiler.synthesis.aqc.make_cnot_network"). +### make\_cnot\_network + `qiskit.transpiler.synthesis.aqc.make_cnot_network(num_qubits, network_layout='spin', connectivity_type='full', depth=0)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/synthesis/aqc/cnot_structures.py "view source code") @@ -159,7 +161,7 @@ One can take advantage of accelerated version of objective function. It implemen The rest of the code in the above example does not change. -## References +**References** **\[1]: Liam Madden, Andrea Simonetto, Best Approximate Quantum Compiling Problems.** diff --git a/docs/api/qiskit/tools.md b/docs/api/qiskit/tools.md index 52a26b29d53..d2e32ede663 100644 --- a/docs/api/qiskit/tools.md +++ b/docs/api/qiskit/tools.md @@ -20,6 +20,8 @@ python_api_name: qiskit.tools A helper function for calling a custom function with python `ProcessPoolExecutor`. Tasks can be executed in parallel using this function. It has a built-in event publisher to show the progress of the parallel tasks. +### parallel\_map + `qiskit.tools.parallel_map(task, values, task_args=(), task_kwargs={}, num_processes=2)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/tools/parallel.py "view source code") @@ -60,7 +62,7 @@ result terra.parallel.start: The collection of parallel tasks are about to start. terra.parallel.update: One of the parallel task has finished. terra.parallel.finish: All the parallel tasks have finished. -## Examples +**Examples** ```python import time @@ -75,6 +77,8 @@ parallel_map(func, list(range(10))); A helper module to get IBM backend information and submitted job status. +### job\_monitor + `qiskit.tools.job_monitor(job, interval=None, quiet=False, output=<_io.TextIOWrapper name='' mode='w' encoding='utf-8'>, line_discipline='\r')`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/tools/monitor/job_monitor.py "view source code") @@ -91,7 +95,7 @@ Monitor the status of a IBMQJob instance. * **line\_discipline** (*string*) – character emitted at start of a line of job monitor output, * **r.** (*This defaults to*) – -## Examples +**Examples** ```python from qiskit import BasicAer, transpile @@ -107,6 +111,8 @@ job_sim = sim_backend.run(tqc) job_monitor(job_sim) ``` +### backend\_monitor + `qiskit.tools.backend_monitor(backend)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/tools/monitor/overview.py "view source code") @@ -126,13 +132,15 @@ Examples: .. code-block:: python > from qiskit.providers.ibmq import IBMQ from qiskit.tools.monitor import backend\_monitor provider = IBMQ.get\_provider(hub=’ibm-q’) backend\_monitor(provider.backends.ibmq\_lima) +### backend\_overview + `qiskit.tools.backend_overview()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/tools/monitor/overview.py "view source code") Gives overview information on all the IBMQ backends that are available. -## Examples +**Examples** ```python from qiskit.providers.ibmq import IBMQ @@ -159,7 +167,7 @@ A simple text-based progress bar. is sys.stdout, another option is sys.stderr -## Examples +**Examples** The progress bar can be used to track the progress of a parallel\_map. diff --git a/docs/api/qiskit/transpiler_plugins.md b/docs/api/qiskit/transpiler_plugins.md index 9ed7aa08d27..a13a33dde18 100644 --- a/docs/api/qiskit/transpiler_plugins.md +++ b/docs/api/qiskit/transpiler_plugins.md @@ -97,6 +97,8 @@ Note that the entry point `name = path` is a single string not a Python expressi | [`PassManagerStagePlugin`](qiskit.transpiler.preset_passmanagers.plugin.PassManagerStagePlugin "qiskit.transpiler.preset_passmanagers.plugin.PassManagerStagePlugin")() | A `PassManagerStagePlugin` is a plugin interface object for using custom stages in [`transpile()`](compiler#qiskit.compiler.transpile "qiskit.compiler.transpile"). | | [`PassManagerStagePluginManager`](qiskit.transpiler.preset_passmanagers.plugin.PassManagerStagePluginManager "qiskit.transpiler.preset_passmanagers.plugin.PassManagerStagePluginManager")() | Manager class for preset pass manager stage plugins. | +### list\_stage\_plugins + `qiskit.transpiler.preset_passmanagers.plugin.list_stage_plugins(stage_name)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/plugin.py "view source code") @@ -119,6 +121,8 @@ plugins [**TranspilerError**](transpiler#qiskit.transpiler.TranspilerError "qiskit.transpiler.TranspilerError") – If an invalid stage name is specified. +### passmanager\_stage\_plugins + `qiskit.transpiler.preset_passmanagers.plugin.passmanager_stage_plugins(stage)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/plugin.py "view source code") diff --git a/docs/api/qiskit/transpiler_preset.md b/docs/api/qiskit/transpiler_preset.md index 87dc4f37f1e..8b1e074653a 100644 --- a/docs/api/qiskit/transpiler_preset.md +++ b/docs/api/qiskit/transpiler_preset.md @@ -24,6 +24,8 @@ This module contains functions for generating the preset pass managers for the t ## Preset Pass Manager Generation +### generate\_preset\_pass\_manager + `qiskit.transpiler.preset_passmanagers.generate_preset_pass_manager(optimization_level, backend=None, target=None, basis_gates=None, inst_map=None, coupling_map=None, instruction_durations=None, backend_properties=None, timing_constraints=None, initial_layout=None, layout_method=None, routing_method=None, translation_method=None, scheduling_method=None, approximation_degree=None, seed_transpiler=None, unitary_synthesis_method='default', unitary_synthesis_plugin_config=None, hls_config=None, init_method=None, optimization_method=None, *, _skip_target=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/__init__.py "view source code") @@ -95,6 +97,8 @@ The preset pass manager for the given options [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – if an invalid value for `optimization_level` is passed in. +### level\_0\_pass\_manager + `qiskit.transpiler.preset_passmanagers.level_0_pass_manager(pass_manager_config)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/level0.py "view source code") @@ -121,6 +125,8 @@ a level 0 pass manager. [*StagedPassManager*](qiskit.transpiler.StagedPassManager "qiskit.transpiler.passmanager.StagedPassManager") +### level\_1\_pass\_manager + `qiskit.transpiler.preset_passmanagers.level_1_pass_manager(pass_manager_config)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/level1.py "view source code") @@ -145,6 +151,8 @@ a level 1 pass manager. [*StagedPassManager*](qiskit.transpiler.StagedPassManager "qiskit.transpiler.passmanager.StagedPassManager") +### level\_2\_pass\_manager + `qiskit.transpiler.preset_passmanagers.level_2_pass_manager(pass_manager_config)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/level2.py "view source code") @@ -171,6 +179,8 @@ a level 2 pass manager. [*StagedPassManager*](qiskit.transpiler.StagedPassManager "qiskit.transpiler.passmanager.StagedPassManager") +### level\_3\_pass\_manager + `qiskit.transpiler.preset_passmanagers.level_3_pass_manager(pass_manager_config)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/level3.py "view source code") @@ -201,6 +211,8 @@ a level 3 pass manager. ## Stage Generator Functions +### generate\_control\_flow\_options\_check + `qiskit.transpiler.preset_passmanagers.common.generate_control_flow_options_check(layout_method=None, routing_method=None, translation_method=None, optimization_method=None, scheduling_method=None, basis_gates=(), target=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/common.py "view source code") @@ -215,12 +227,16 @@ a pass manager that populates the `contains_x` properties for each of the contro [PassManager](qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") +### generate\_error\_on\_control\_flow + `qiskit.transpiler.preset_passmanagers.common.generate_error_on_control_flow(message)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/common.py "view source code") Get a pass manager that always raises an error if control flow is present in a given circuit. +### generate\_unroll\_3q + `qiskit.transpiler.preset_passmanagers.common.generate_unroll_3q(target, basis_gates=None, approximation_degree=None, unitary_synthesis_method='default', unitary_synthesis_plugin_config=None, hls_config=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/common.py "view source code") @@ -244,6 +260,8 @@ The unroll 3q or more pass manager [PassManager](qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") +### generate\_embed\_passmanager + `qiskit.transpiler.preset_passmanagers.common.generate_embed_passmanager(coupling_map)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/common.py "view source code") @@ -266,6 +284,8 @@ set has been set in earlier stages [PassManager](qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") +### generate\_routing\_passmanager + `qiskit.transpiler.preset_passmanagers.common.generate_routing_passmanager(routing_pass, target, coupling_map=None, vf2_call_limit=None, backend_properties=None, seed_transpiler=None, check_trivial=False, use_barrier_before_measurement=True, vf2_max_trials=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/common.py "view source code") @@ -292,6 +312,8 @@ The routing pass manager [PassManager](qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") +### generate\_pre\_op\_passmanager + `qiskit.transpiler.preset_passmanagers.common.generate_pre_op_passmanager(target=None, coupling_map=None, remove_reset_in_zero=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/common.py "view source code") @@ -314,6 +336,8 @@ The pass manager [PassManager](qiskit.transpiler.PassManager "qiskit.transpiler.PassManager") +### generate\_translation\_passmanager + `qiskit.transpiler.preset_passmanagers.common.generate_translation_passmanager(target, basis_gates=None, method='translator', approximation_degree=None, coupling_map=None, backend_props=None, unitary_synthesis_method='default', unitary_synthesis_plugin_config=None, hls_config=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/common.py "view source code") @@ -344,6 +368,8 @@ The basis translation pass manager [**TranspilerError**](transpiler#qiskit.transpiler.TranspilerError "qiskit.transpiler.TranspilerError") – If the `method` kwarg is not a valid value +### generate\_scheduling + `qiskit.transpiler.preset_passmanagers.common.generate_scheduling(instruction_durations, scheduling_method, timing_constraints, inst_map, target=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/transpiler/preset_passmanagers/common.py "view source code") diff --git a/docs/api/qiskit/utils.md b/docs/api/qiskit/utils.md index 62044afb176..bb44de681bf 100644 --- a/docs/api/qiskit/utils.md +++ b/docs/api/qiskit/utils.md @@ -18,6 +18,8 @@ python_api_name: qiskit.utils `qiskit.utils` +### add\_deprecation\_to\_docstring + `qiskit.utils.add_deprecation_to_docstring(func, msg, *, since, pending)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/deprecation.py "view source code") @@ -31,6 +33,8 @@ Dynamically insert the deprecation message into `func`’s docstring. * **since** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") *| None*) – The version the deprecation started at. * **pending** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")) – Is the deprecation still pending? +### deprecate\_arg + `qiskit.utils.deprecate_arg(name, *, since, additional_msg=None, deprecation_description=None, pending=False, package_name='qiskit', new_alias=None, predicate=None, removal_timeline='no earlier than 3 months after the release date')`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/deprecation.py "view source code") @@ -59,6 +63,8 @@ The decorated callable. Callable +### deprecate\_arguments + `qiskit.utils.deprecate_arguments(kwarg_map, category=, *, since=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/deprecation.py "view source code") @@ -79,6 +85,8 @@ The decorated callable. Callable +### deprecate\_func + `qiskit.utils.deprecate_func(*, since, additional_msg=None, pending=False, package_name='qiskit', removal_timeline='no earlier than 3 months after the release date', is_property=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/deprecation.py "view source code") @@ -106,6 +114,8 @@ The decorated callable. Callable +### deprecate\_function + `qiskit.utils.deprecate_function(msg, stacklevel=2, category=, *, since=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/deprecation.py "view source code") @@ -127,6 +137,8 @@ The decorated, deprecated callable. Callable +### local\_hardware\_info + `qiskit.utils.local_hardware_info()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/multiprocessing.py "view source code") @@ -143,12 +155,16 @@ The hardware information. [dict](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.12)") +### is\_main\_process + `qiskit.utils.is_main_process()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/multiprocessing.py "view source code") Checks whether the current process is the main one +### apply\_prefix + `qiskit.utils.apply_prefix(value, unit)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/units.py "view source code") @@ -180,6 +196,8 @@ Converted value. [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)") | [ParameterExpression](qiskit.circuit.ParameterExpression "qiskit.circuit.ParameterExpression") +### detach\_prefix + `qiskit.utils.detach_prefix(value, decimal=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/units.py "view source code") @@ -188,7 +206,7 @@ Given a SI unit value, find the most suitable prefix to scale the value. For example, the `value = 1.3e8` will be converted into a tuple of `(130.0, "M")`, which represents a scaled value and auxiliary unit that may be used to display the value. In above example, that value might be displayed as `130 MHz` (unit is arbitrary here). -## Example +**Example** ```python >>> value, prefix = detach_prefix(1e4) @@ -222,6 +240,8 @@ A tuple of scaled value and prefix. [tuple](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.12)")\[[float](https://docs.python.org/3/library/functions.html#float "(in Python v3.12)"), [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")] +### wrap\_method + `qiskit.utils.wrap_method(cls, name, *, before=None, after=None)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/classtools.py "view source code") @@ -245,6 +265,8 @@ If either `before` or `after` are given, they should be callables with a compati ## Algorithm Utilities +### summarize\_circuits + `qiskit.utils.summarize_circuits(circuits)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/circuit_utils.py "view source code") @@ -271,6 +293,8 @@ a formatted string records the summary [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)") +### get\_entangler\_map + `qiskit.utils.get_entangler_map(map_type, num_qubits, offset=0)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/entangler_map.py "view source code") @@ -295,6 +319,8 @@ A map of qubit index to an array of indexes to which this should be entangled [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – if map\_type is not valid. +### validate\_entangler\_map + `qiskit.utils.validate_entangler_map(entangler_map, num_qubits, allow_double_entanglement=False)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/entangler_map.py "view source code") @@ -321,6 +347,8 @@ Validated/converted map * [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – the index of entangler map is out of range * [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.12)") – the qubits are cross-entangled. +### has\_ibmq + `qiskit.utils.has_ibmq()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/backend_utils.py "view source code") @@ -331,6 +359,8 @@ Check if IBMQ is installed. The function `qiskit.utils.backend_utils.has_ibmq()` is deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. For code migration guidelines, visit [https://qisk.it/qi\_migration](https://qisk.it/qi_migration). +### has\_aer + `qiskit.utils.has_aer()`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/backend_utils.py "view source code") @@ -341,6 +371,8 @@ Check if Aer is installed. The function `qiskit.utils.backend_utils.has_aer()` is deprecated as of qiskit-terra 0.24.0. It will be removed no earlier than 3 months after the release date. For code migration guidelines, visit [https://qisk.it/qi\_migration](https://qisk.it/qi_migration). +### name\_args + `qiskit.utils.name_args(mapping, skip=0)`[GitHub](https://github.com/qiskit/qiskit/tree/stable/0.45/qiskit/utils/name_unnamed_args.py "view source code") diff --git a/scripts/lib/api/processHtml.test.ts b/scripts/lib/api/processHtml.test.ts index 76dfdaf7363..7bf1275c871 100644 --- a/scripts/lib/api/processHtml.test.ts +++ b/scripts/lib/api/processHtml.test.ts @@ -24,7 +24,9 @@ import { removePermalinks, removeColonSpans, replaceViewcodeLinksWithGitHub, + convertRubricsToHeaders, prepareGitHubLink, + processMembersAndSetMeta, } from "./processHtml"; import { Metadata } from "./Metadata"; @@ -247,6 +249,26 @@ test("replaceSourceLinksWithGitHub()", () => { ); }); +test("convertRubricsToHeaders()", () => { + const doc = Doc.load(`

Example

+

Examples

+

References

+

Reference

+

Simple examples

+

Example code

+

Attributes

+

Methods

`); + convertRubricsToHeaders(doc.$, doc.$main); + doc.expectHtml(`Example + Examples + References + Reference + Simple examples + Example code +

Attributes

+

Methods

`); +}); + describe("maybeSetModuleMetadata()", () => { test("not a module", () => { const html = `

Hello

`; @@ -313,3 +335,98 @@ describe("prepareGitHubLink()", () => { ); }); }); + +describe("processMembersAndSetMeta()", () => { + test("function with added heading", () => { + const html = `

Circuit Converters

+
+
+qiskit.converters.circuit_to_dag(circuit, copy_operations=True, *, qubit_order=None, clbit_order=None)[source]
+

Build a DAGCircuit object from a QuantumCircuit.

+
+
Parameters:
+
    +
  • circuit – the input circuit.

  • +
  • copy_operations – Deep copy the operation objects in the QuantumCircuit for the output DAGCircuit.

  • +
+
`; + const doc = Doc.load(html); + const meta: Metadata = {}; + processMembersAndSetMeta(doc.$, doc.$main, meta); + doc.expectHtml(`

Circuit Converters

+

circuit_to_dag

+qiskit.converters.circuit_to_dag(circuit, copy_operations=True, *, qubit_order=None, clbit_order=None)GitHub

+

Build a DAGCircuit object from a QuantumCircuit.

+
+
Parameters:
+
    +
  • circuit – the input circuit.

  • +
  • copy_operations – Deep copy the operation objects in the QuantumCircuit for the output DAGCircuit.

  • +
+
`); + expect(meta).toEqual({ + apiType: "function", + apiName: "qiskit.converters.circuit_to_dag", + }); + }); + + test("function without added heading", () => { + const html = `

least_busy

+
+
+least_busy(backends)[source]
+

Return the least busy backend from a list.

+

Return the least busy available backend for those that +have a pending_jobs in their status. Note that local +backends may not have this attribute.

+
+
Parameters:
+

backends (List[Backend]) – The backends to choose from.

+
+
Return type:
+

Backend

+
+
Returns:
+

The backend with the fewest number of pending jobs.

+
+
Raises:
+

IBMError – If the backends list is empty, or if none of the backends + is available, or if a backend in the list + does not have the pending_jobs attribute in its status.

+
+
+
+`; + const doc = Doc.load(html); + const meta: Metadata = {}; + processMembersAndSetMeta(doc.$, doc.$main, meta); + doc.expectHtml(`

least_busy

+

+least_busy(backends)GitHub

+

Return the least busy backend from a list.

+

Return the least busy available backend for those that +have a pending_jobs in their status. Note that local +backends may not have this attribute.

+
+
Parameters:
+

backends (List[Backend]) – The backends to choose from.

+
+
Return type:
+

Backend

+
+
Returns:
+

The backend with the fewest number of pending jobs.

+
+
Raises:
+

IBMError – If the backends list is empty, or if none of the backends + is available, or if a backend in the list + does not have the pending_jobs attribute in its status.

+
+
+
`); + expect(meta).toEqual({ + apiType: "function", + apiName: "qiskit_ibm_provider.least_busy", + }); + }); +}); diff --git a/scripts/lib/api/processHtml.ts b/scripts/lib/api/processHtml.ts index bfd78e2f3a4..cc9dcd37076 100644 --- a/scripts/lib/api/processHtml.ts +++ b/scripts/lib/api/processHtml.ts @@ -194,12 +194,18 @@ export function convertRubricsToHeaders( $: CheerioAPI, $main: Cheerio, ): void { - // Rubrics correspond to method and attribute headers. - // TODO(#479): ensure our understanding of what .rubric corresponds to is correct and figure out - // if always using

makes sense. + // A rubric is "a paragraph heading that is not used to create a table + // of contents node". Depending on the heading, this should be either

or + // + function appropriateHtmlTag(html: string | null) { + html = String(html); + return html == "Methods" || html == "Attributes" ? "h2" : "strong"; + } + $main.find(".rubric").each((_, el) => { const $el = $(el); - $el.replaceWith(`

${$el.html()}

`); + const tag = appropriateHtmlTag($el.html()); + $el.replaceWith(`<${tag}>${$el.html()}`); }); } @@ -353,7 +359,16 @@ export function processMembersAndSetMeta( if (apiType === "function") { findByText($, $main, "em.property", "function").remove(); - return `

${$child.html()}${github}

`; + const funcDescription = `

${$child.html()}${github}

`; + + const pageHeading = $dl.siblings("h1").text(); + if (id.endsWith(pageHeading) && pageHeading != "") { + // Page is already dedicated to function; no heading needed + return funcDescription; + } + + const funcName = id.split(".").slice(-1)[0]; + return `

${funcName}

${funcDescription}`; } if (apiType === "exception") {