All Questions
Tagged with pauli-gates qiskit
29 questions
0
votes
1
answer
62
views
Coding a hamiltonian in qiskit
I have a hamiltonian of the form:
$H=\sum_{i=1}^N Z_i Z_{i+1}-Z_NZ_1$
And another one as:
$H=-\sum_{i=1}^N X_i$
I need it to it for N terms.
I am a bit lost can anybody help. I tried looking for ...
0
votes
0
answers
42
views
How can I measure qutrits in the X basis using cirq?
I attempted to create a custom measurement class which, in my case, allows us to go from the z basis to x basis using a hadamard gate transformation, and then we measure wrt that new basis. However, ...
0
votes
1
answer
363
views
Expectation value of a given observable computed manually using qiskit.Sampler is different as with qiskit.Estimator
I am trying to calculate the expectation value of a given observable for a certain state $\psi$ using qiskit primitives Sampler (using Sampler requires some further calculations) and Estimator. I ...
1
vote
0
answers
98
views
Measuring a single-qubit PauliZ using Qiskit's EstimatorQNN
I am currently working with the EstimatorQNN from Qiskit to construct a Quantum Neural Network using a custom Parametrized Quantum Circuit. But I want to change the ...
2
votes
1
answer
544
views
Coupling map in QISKIT transpile
I have a 3-qubit unitary represented by a circuit with the following dictionary: {'cx': 30, 'h': 22, 'rz': 15, 's': 4, 'sdg': 4}. I want to use this circuit on IBM ...
2
votes
1
answer
407
views
Half Adder using CNOT Gates
As per this schematic of qubits, how this explanation is correct --"If you look again at the four possible sums, you’ll notice that there is only one case for which this is 1 instead of 0: 1+1=10....
1
vote
2
answers
844
views
Can any Qiskit circuit be converted to a gate?
I am trying to convert the following qiskit QuantumCircuit to a gate using to_gate() method.
...
0
votes
2
answers
57
views
Visualizing Y-gate operation to achieve quantum state
In the below snippet how qc.y(1) helps to achieve the quantum state $i|10\rangle$ ?
...
2
votes
2
answers
474
views
How can I implement a Hamiltonian which is sum of tensored pauli operators on qiskit?
I am working with a Tight Binding Hamiltonian with N sites and one orbital at each site in a closed chain. I have converted the fermionic expression to a spin expression using Jordan Wigner ...
1
vote
0
answers
575
views
Pauli decomposed Hamiltonian as Diagonal U gate
While trying to implement a quantum circuit, I had to apply Hadamard gates to all qubits to achieve equal superposition. Done.
The next operation is decomposing the Hamiltonian into a sum of tensor ...
1
vote
1
answer
102
views
Given a unitary matrix, output the gate name using Qiskit
Given a unitary matrix of a unknown gate, can we write a program in Qiskit to output the name of the corresponding gate if that is a standard gate?
So suppose I have $U = \begin{pmatrix}
0 & 1\\
...
1
vote
2
answers
152
views
How to find angle for Pauli-Z in U3
What are the angles (lambda, phi and theta) for Pauli-Z gate in U3 ?
0
votes
1
answer
120
views
Expectation values of non-local operators in Qiskit
Is there a convenient way in Qiskit to calculate the expectation value for a non-local operator, i.e. I would like to calculate:
$$ \langle \Psi|O|\Psi \rangle $$
More precisely, I would like to ...
1
vote
2
answers
464
views
Expectation value of Pauli strings for VQE
I am studying VQE and have boiled it down to a matter of determining the expectation value of Pauli strings:
$$\langle H \rangle = \sum_i \alpha_i \langle\psi|\hat{P_i}|\psi\rangle.$$
I have been ...
1
vote
2
answers
157
views
Is it true that $Ry(\pi/2)\sigma_zRy(-\pi/2)=\sigma_x$?
I saw in a qiskit document that said $Ry(\pi/2)\sigma_zRy(-\pi/2)=\sigma_x$ To confirm this I decided to create the matrix representations of these operations and multiply them together to see if I ...
3
votes
1
answer
3k
views
How does the ZZ Feature Map influence the measurement?
I've been look at this Notebook from qiskit and trying to understand whats happening, but can't quite figure it out.
From my understanding, rotations around the Z ...
2
votes
2
answers
193
views
Qiskit's PauliTrotterEvolution yields weird gates
I am trying to work with Qiskit's PauliTrotterEvolution() module, but the resulting circuits contain weird gates that I know nothing about.
Here is a simple example: I want to implement the fermionic ...
7
votes
3
answers
3k
views
Why isn't $Ry(\pi/2)$ gate equivalent to Hadamard gate?
I've been experimenting with quantum circuits and can't quite fathom how the difference between states comes together.
Speaking in terms of simulations using qiskit,...
2
votes
1
answer
803
views
Measuring tensor products of Pauli operators
Is there a neat way to derive and efficiently implement a measurement circuit for tensor products of arbitrary Pauli operators like $XZZXZ$ in Qiskit ?
I tried using the ...
2
votes
2
answers
3k
views
Qiskit CNOT-gate matrix mixup?
In the qiskit textbook chapter 1.3.1 "The CNOT-Gate" it says that the matrix representation on the right is the own corresponding to the circuit shown above, with q_0 being the control and ...
2
votes
1
answer
84
views
Qiskit PauliWeightedOperator in the matrix representation?
Suppose we have a PauliWeightedOperator object from Qiskit. Is there any built-in method to convert it to the matrix representation in the computational basis? My search in the docs was not successful....
2
votes
1
answer
1k
views
Principal square root of Pauli Y gate in Qiskit?
I've seen a similar question asked (How do I compute the square root of the $Y$ gate?) but I'm trying to understand how I can use the gates $Y^{\frac{1}{2}}$ or $Y^{\frac{1}{4}}$ in Qiskit in terms of ...
6
votes
2
answers
2k
views
controlled-Z rotation gates in symmetrical fashion
I was going through the qiskit textbook and in this chapter I came across a statement under the topic "Kickback with the T-gate" related to the Controlled-Z gate that
the controlled-Z ...
1
vote
0
answers
286
views
Changing the Basis
I am attempting to use a VQE algorithm to find the ground state of a deuterium nucleus by applying a constructed hamiltonian to an ansatz state with one parameter created by a circuit. While I am ...
4
votes
1
answer
491
views
Is there a function in Qiskit to measure tensor products of Pauli operators?
Is there a function in Qiskit similar to this function in Q# which measures strings of Pauli operators applied to different qubits?
2
votes
1
answer
573
views
Qiskit flipped representation of qubits in CNOT gate?
The conventional CNOT gate is shown on the right, and the Qiskit version is on the left. Since Qiskit defines it has a flipped representation kindly explain what is happening to the 11 position?
3
votes
1
answer
182
views
Generate the state $\frac{-|0\rangle + |1\rangle}{\sqrt{2}}$ with qiskit: problem with Pauli-Z behavior
I want to construct the following state of a qubit using a quantum circuit: $\frac{-|0\rangle + |1\rangle}{\sqrt{2}}$
When I use the following qiskit code in Python:
...
3
votes
1
answer
994
views
Expected value of a product of the Pauli matrices in different bases
I'm trying to reproduce the results of this article https://arxiv.org/abs/1801.03897, using Qiskit and Xanadu PennyLane.
Particularly, this part with expected values of the Pauli operators:
For ...
2
votes
1
answer
2k
views
CRZ and CRY Gates
I am trying to understand the function of the $CR_z$ and $CR_y$ gates.
Why are these gates used in practice? What advantage is gained by rotating a qubit around the $y$- or $z$-axis?
For example, this ...