Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicated method in qiskit.providers.BackendV1 #1412

Merged
merged 4 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions docs/api/qiskit/0.45/qiskit.providers.BackendV1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,6 @@ python_api_name: qiskit.providers.BackendV1

[**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.12)") – if input field not a valid options

In addition to the public abstract methods, subclasses should also implement the following private methods:

<Function signature="_default_options()" modifiers="abstract classmethod">
Return the default options

This method will return a [`qiskit.providers.Options`](qiskit.providers.Options "qiskit.providers.Options") subclass object that will be used for the default options. These should be the default parameters to use for the options of the backend.

**Returns**

**A options object with**

default values set

**Return type**

[qiskit.providers.Options](qiskit.providers.Options "qiskit.providers.Options")
</Function>

## Attributes

### options
Expand Down
18 changes: 0 additions & 18 deletions docs/api/qiskit/0.46/qiskit.providers.BackendV1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,6 @@ python_api_name: qiskit.providers.BackendV1

[**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.12)") – if input field not a valid options

In addition to the public abstract methods, subclasses should also implement the following private methods:

<Function signature="_default_options()" modifiers="abstract classmethod">
Return the default options

This method will return a [`qiskit.providers.Options`](qiskit.providers.Options "qiskit.providers.Options") subclass object that will be used for the default options. These should be the default parameters to use for the options of the backend.

**Returns**

**A options object with**

default values set

**Return type**

[qiskit.providers.Options](qiskit.providers.Options "qiskit.providers.Options")
</Function>

## Attributes

### options
Expand Down
18 changes: 0 additions & 18 deletions docs/api/qiskit/1.0/qiskit.providers.BackendV1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -49,24 +49,6 @@ python_api_name: qiskit.providers.BackendV1

[**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.12)") – if input field not a valid options

In addition to the public abstract methods, subclasses should also implement the following private methods:

<Function github="https://github.com/Qiskit/qiskit/tree/stable/1.0/qiskit/providers/backend.py#L107-L120" signature="_default_options()" modifiers="abstract classmethod">
Return the default options

This method will return a [`qiskit.providers.Options`](qiskit.providers.Options "qiskit.providers.Options") subclass object that will be used for the default options. These should be the default parameters to use for the options of the backend.

**Returns**

**A options object with**

default values set

**Return type**

[qiskit.providers.Options](qiskit.providers.Options "qiskit.providers.Options")
</Function>

## Attributes

### options
Expand Down
6 changes: 3 additions & 3 deletions docs/api/qiskit/dev/circuit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,10 @@ If the subclass is using the singleton machinery, beware that [`_define()`](#qis

Subclasses of [`Gate`](qiskit.circuit.Gate "qiskit.circuit.Gate") will also likely wish to override [the Numpy array-protocol instance method](https://numpy.org/devdocs/user/basics.interoperability.html#the-array-method), `__array__`. This is used by [`Gate.to_matrix()`](qiskit.circuit.Gate#to_matrix "qiskit.circuit.Gate.to_matrix"), and has the signature:

#### array\_\_
#### \_\_array\_\_

<Function id="array__" signature="__array__(dtype=None, copy=None)">
Return a Numpy array representing the gate. This can use the gate’s `params` field, and may assume that these are numeric values (assuming the subclass expects that) and not [compile-time parameters](#circuit-compile-time-parameters).
<Function id="object.__array__" signature="object.__array__(dtype=None, copy=None)">
Return a Numpy array representing the gate. This can use the gate’s [`params`](qiskit.circuit.Instruction#params "qiskit.circuit.Instruction.params") field, and may assume that these are numeric values (assuming the subclass expects that) and not [compile-time parameters](#circuit-compile-time-parameters).

For greatest efficiency, the returned array should default to a dtype of [`complex`](https://docs.python.org/3/library/functions.html#complex "(in Python v3.12)").
</Function>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ $$
>>> from qiskit.circuit.library import EfficientSU2
>>> prep = PauliFeatureMap(3, reps=3, paulis=['Z', 'YY', 'ZXZ'])
>>> wavefunction = EfficientSU2(3)
>>> classifier = prep.compose(wavefunction
>>> classifier = prep.compose(wavefunction)
>>> classifier.num_parameters
27
>>> classifier.count_ops()
Expand Down
7 changes: 4 additions & 3 deletions docs/api/qiskit/dev/qiskit.circuit.library.UnitaryOverlap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python_api_name: qiskit.circuit.library.UnitaryOverlap

# UnitaryOverlap

<Class id="qiskit.circuit.library.UnitaryOverlap" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit/tree/main/qiskit/circuit/library/overlap.py#L21-L98" signature="qiskit.circuit.library.UnitaryOverlap(unitary1, unitary2, prefix1='p1', prefix2='p2')" modifiers="class">
<Class id="qiskit.circuit.library.UnitaryOverlap" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit/tree/main/qiskit/circuit/library/overlap.py#L21-L106" signature="qiskit.circuit.library.UnitaryOverlap(unitary1, unitary2, prefix1='p1', prefix2='p2', insert_barrier=False)" modifiers="class">
Bases: [`QuantumCircuit`](qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit")

Circuit that returns the overlap between two unitaries $U_2^{\dag} U_1$.
Expand Down Expand Up @@ -50,8 +50,9 @@ $$

* **unitary1** ([*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit")) – Unitary acting on the ket vector.
* **unitary2** ([*QuantumCircuit*](qiskit.circuit.QuantumCircuit "qiskit.circuit.quantumcircuit.QuantumCircuit")) – Unitary whose inverse operates on the bra vector.
* **prefix1** – The name of the parameter vector associated to `unitary1`, if it is parameterized. Defaults to `"p1"`.
* **prefix2** – The name of the parameter vector associated to `unitary2`, if it is parameterized. Defaults to `"p2"`.
* **prefix1** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")) – The name of the parameter vector associated to `unitary1`, if it is parameterized. Defaults to `"p1"`.
* **prefix2** ([*str*](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.12)")) – The name of the parameter vector associated to `unitary2`, if it is parameterized. Defaults to `"p2"`.
* **insert\_barrier** ([*bool*](https://docs.python.org/3/library/functions.html#bool "(in Python v3.12)")) – Whether to insert a barrier between the two unitaries.

**Raises**

Expand Down
36 changes: 9 additions & 27 deletions docs/api/qiskit/dev/qiskit.providers.BackendV1.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python_api_name: qiskit.providers.BackendV1

# BackendV1

<Class id="qiskit.providers.BackendV1" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L40-L242" signature="qiskit.providers.BackendV1(configuration, provider=None, **fields)" modifiers="class">
<Class id="qiskit.providers.BackendV1" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L40-L236" signature="qiskit.providers.BackendV1(configuration, provider=None, **fields)" modifiers="class">
Bases: [`Backend`](qiskit.providers.Backend "qiskit.providers.backend.Backend"), [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC "(in Python v3.12)")

Abstract class for Backends
Expand All @@ -21,7 +21,7 @@ python_api_name: qiskit.providers.BackendV1

### \_default\_options

<Function id="qiskit.providers.BackendV1._default_options" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L107-L120" signature="_default_options()" modifiers="abstract classmethod">
<Function id="qiskit.providers.BackendV1._default_options" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L101-L114" signature="_default_options()" modifiers="abstract classmethod">
Return the default options

This method will return a [`qiskit.providers.Options`](qiskit.providers.Options "qiskit.providers.Options") subclass object that will be used for the default options. These should be the default parameters to use for the options of the backend.
Expand Down Expand Up @@ -49,24 +49,6 @@ python_api_name: qiskit.providers.BackendV1

[**AttributeError**](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.12)") – if input field not a valid options

In addition to the public abstract methods, subclasses should also implement the following private methods:

<Function github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L107-L120" signature="_default_options()" modifiers="abstract classmethod">
Return the default options

This method will return a [`qiskit.providers.Options`](qiskit.providers.Options "qiskit.providers.Options") subclass object that will be used for the default options. These should be the default parameters to use for the options of the backend.

**Returns**

**A options object with**

default values set

**Return type**

[qiskit.providers.Options](qiskit.providers.Options "qiskit.providers.Options")
</Function>

## Attributes

### options
Expand All @@ -85,7 +67,7 @@ python_api_name: qiskit.providers.BackendV1

### configuration

<Function id="qiskit.providers.BackendV1.configuration" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L141-L147" signature="configuration()">
<Function id="qiskit.providers.BackendV1.configuration" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L135-L141" signature="configuration()">
Return the backend configuration.

**Returns**
Expand All @@ -99,7 +81,7 @@ python_api_name: qiskit.providers.BackendV1

### name

<Function id="qiskit.providers.BackendV1.name" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L180-L186" signature="name()">
<Function id="qiskit.providers.BackendV1.name" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L174-L180" signature="name()">
Return the backend name.

**Returns**
Expand All @@ -113,7 +95,7 @@ python_api_name: qiskit.providers.BackendV1

### properties

<Function id="qiskit.providers.BackendV1.properties" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L149-L156" signature="properties()">
<Function id="qiskit.providers.BackendV1.properties" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L143-L150" signature="properties()">
Return the backend properties.

**Returns**
Expand All @@ -127,7 +109,7 @@ python_api_name: qiskit.providers.BackendV1

### provider

<Function id="qiskit.providers.BackendV1.provider" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L158-L164" signature="provider()">
<Function id="qiskit.providers.BackendV1.provider" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L152-L158" signature="provider()">
Return the backend Provider.

**Returns**
Expand All @@ -141,7 +123,7 @@ python_api_name: qiskit.providers.BackendV1

### run

<Function id="qiskit.providers.BackendV1.run" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L212-L242" signature="run(run_input, **options)" modifiers="abstract">
<Function id="qiskit.providers.BackendV1.run" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L206-L236" signature="run(run_input, **options)" modifiers="abstract">
Run on the backend.

This method returns a [`Job`](qiskit.providers.Job "qiskit.providers.Job") object that runs circuits. Depending on the backend this may be either an async or sync call. It is at the discretion of the provider to decide whether running should block until the execution is finished or not: the Job class can handle either situation.
Expand All @@ -162,7 +144,7 @@ python_api_name: qiskit.providers.BackendV1

### set\_options

<Function id="qiskit.providers.BackendV1.set_options" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L122-L139" signature="set_options(**fields)">
<Function id="qiskit.providers.BackendV1.set_options" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L116-L133" signature="set_options(**fields)">
Set the options fields for the backend

This method is used to update the options of a backend. If you need to change any of the options prior to running just pass in the kwarg with the new value for the options.
Expand All @@ -178,7 +160,7 @@ python_api_name: qiskit.providers.BackendV1

### status

<Function id="qiskit.providers.BackendV1.status" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L166-L178" signature="status()">
<Function id="qiskit.providers.BackendV1.status" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L160-L172" signature="status()">
Return the backend status.

**Returns**
Expand Down
18 changes: 9 additions & 9 deletions docs/api/qiskit/dev/qiskit.providers.BackendV2.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ python_api_name: qiskit.providers.BackendV2

# BackendV2

<Class id="qiskit.providers.BackendV2" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L273-L653" signature="qiskit.providers.BackendV2(provider=None, name=None, description=None, online_date=None, backend_version=None, **fields)" modifiers="class">
<Class id="qiskit.providers.BackendV2" isDedicatedPage={true} github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L267-L647" signature="qiskit.providers.BackendV2(provider=None, name=None, description=None, online_date=None, backend_version=None, **fields)" modifiers="class">
Bases: [`Backend`](qiskit.providers.Backend "qiskit.providers.backend.Backend"), [`ABC`](https://docs.python.org/3/library/abc.html#abc.ABC "(in Python v3.12)")

Abstract class for Backends
Expand All @@ -25,7 +25,7 @@ python_api_name: qiskit.providers.BackendV2

### \_default\_options

<Function id="qiskit.providers.BackendV2._default_options" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L426-L440" signature="_default_options()" modifiers="abstract classmethod">
<Function id="qiskit.providers.BackendV2._default_options" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L420-L434" signature="_default_options()" modifiers="abstract classmethod">
Return the default options

This method will return a [`qiskit.providers.Options`](qiskit.providers.Options "qiskit.providers.Options") subclass object that will be used for the default options. These should be the default parameters to use for the options of the backend.
Expand Down Expand Up @@ -214,7 +214,7 @@ python_api_name: qiskit.providers.BackendV2

### acquire\_channel

<Function id="qiskit.providers.BackendV2.acquire_channel" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L554-L567" signature="acquire_channel(qubit)">
<Function id="qiskit.providers.BackendV2.acquire_channel" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L548-L561" signature="acquire_channel(qubit)">
Return the acquisition channel for the given qubit.

This is required to be implemented if the backend supports Pulse scheduling.
Expand All @@ -234,7 +234,7 @@ python_api_name: qiskit.providers.BackendV2

### control\_channel

<Function id="qiskit.providers.BackendV2.control_channel" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L569-L589" signature="control_channel(qubits)">
<Function id="qiskit.providers.BackendV2.control_channel" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L563-L583" signature="control_channel(qubits)">
Return the secondary drive channel for the given qubit

This is typically utilized for controlling multiqubit interactions. This channel is derived from other channels.
Expand All @@ -260,7 +260,7 @@ python_api_name: qiskit.providers.BackendV2

### drive\_channel

<Function id="qiskit.providers.BackendV2.drive_channel" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L524-L537" signature="drive_channel(qubit)">
<Function id="qiskit.providers.BackendV2.drive_channel" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L518-L531" signature="drive_channel(qubit)">
Return the drive channel for the given qubit.

This is required to be implemented if the backend supports Pulse scheduling.
Expand All @@ -280,7 +280,7 @@ python_api_name: qiskit.providers.BackendV2

### measure\_channel

<Function id="qiskit.providers.BackendV2.measure_channel" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L539-L552" signature="measure_channel(qubit)">
<Function id="qiskit.providers.BackendV2.measure_channel" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L533-L546" signature="measure_channel(qubit)">
Return the measure stimulus channel for the given qubit.

This is required to be implemented if the backend supports Pulse scheduling.
Expand All @@ -300,7 +300,7 @@ python_api_name: qiskit.providers.BackendV2

### qubit\_properties

<Function id="qiskit.providers.BackendV2.qubit_properties" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L490-L522" signature="qubit_properties(qubit)">
<Function id="qiskit.providers.BackendV2.qubit_properties" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L484-L516" signature="qubit_properties(qubit)">
Return QubitProperties for a given qubit.

If there are no defined or the backend doesn’t support querying these details this method does not need to be implemented.
Expand All @@ -324,7 +324,7 @@ python_api_name: qiskit.providers.BackendV2

### run

<Function id="qiskit.providers.BackendV2.run" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L629-L653" signature="run(run_input, **options)" modifiers="abstract">
<Function id="qiskit.providers.BackendV2.run" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L623-L647" signature="run(run_input, **options)" modifiers="abstract">
Run on the backend.

This method returns a [`Job`](qiskit.providers.Job "qiskit.providers.Job") object that runs circuits. Depending on the backend this may be either an async or sync call. It is at the discretion of the provider to decide whether running should block until the execution is finished or not: the Job class can handle either situation.
Expand All @@ -345,7 +345,7 @@ python_api_name: qiskit.providers.BackendV2

### set\_options

<Function id="qiskit.providers.BackendV2.set_options" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L591-L608" signature="set_options(**fields)">
<Function id="qiskit.providers.BackendV2.set_options" github="https://github.com/Qiskit/qiskit/tree/main/qiskit/providers/backend.py#L585-L602" signature="set_options(**fields)">
Set the options fields for the backend

This method is used to update the options of a backend. If you need to change any of the options prior to running just pass in the kwarg with the new value for the options.
Expand Down
Loading
Loading