This question follows the post https://quantumcomputing.stackexchange.com/posts/15070/edit.

I am working on an implementation of HHL algorithm, to do so, I need to map $|\lambda\rangle\mapsto |\arcsin(\frac{C}{\lambda})\rangle$, where $|\arcsin(\frac{C}{\lambda})\rangle$ is a binary representation $\arcsin(\frac{C}{\lambda})$ with $m$ qubits.

Recently, a circuit implementing a Piecewise Chebyshev approximation of a given function $f$ was implemented in Qiskit, documentation can be found here : https://qiskit.org/documentation/stubs/qiskit.circuit.library.PiecewiseChebyshev.html#qiskit-circuit-library-piecewisechebyshev.

I was working on the given example:

import numpy as np
from qiskit import QuantumCircuit
from qiskit.circuit.library.arithmetic.piecewise_chebyshev import PiecewiseChebyshev

f_x, degree, breakpoints, num_state_qubits = lambda x: 0, 2, None, 2
pw_approximation = PiecewiseChebyshev(f_x, degree, breakpoints, num_state_qubits)
qc = QuantumCircuit(pw_approximation.num_qubits)
qc.append(pw_approximation.to_instruction(), qc.qubits)

which should implement a piecewise approximation of the zero function on two qubits ... We can take a look of what the circuit looks like:

enter image description here

the first and second qubits are state qubits and I guess that the three others are ancillary qubits.

The initial state of the system is set to $\frac{1}{2} (|00\rangle+|01\rangle+|10\rangle+|11\rangle)$ so we may look at all possible results of the approximation.

But while looking at measurements of the output qubits, I am facing weird results:

enter image description here

The third qubit is set to one, while the two first are unchanged. I tried a lot of different functions to understand how one can interpret the resulting qubits, but I still cannot figure out what the circuit does. Does anyone have an idea ?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.