ExactReciprocal
class qiskit.circuit.library.ExactReciprocal(num_state_qubits, scaling, neg_vals=False, name='1/x')
Bases: QuantumCircuit
Exact reciprocal
Parameters
- num_state_qubits (int) – The number of qubits representing the value to invert.
- scaling (float) – Scaling factor of the reciprocal function, i.e. to compute .
- neg_vals (bool) – Whether might represent negative values. In this case the first qubit is the sign, with for negative and for positive. For the negative case it is assumed that the remaining string represents . This is because for .
- name (str) – The name of the object.
Note
It is assumed that the binary string represents a number < 1.
Attributes
name
Type: str
A human-readable name for the circuit.
Example
from qiskit import QuantumCircuit
qc = QuantumCircuit(2, 2, name="my_circuit")
print(qc.name)
my_circuit