3

While you can get the unitary matrix representation of a circuit using the unitary simulator as shown in the other answers, there is a much easier way using the Operator class in the qiskit.quantum_info library. import qiskit.quantum_info as qi op = qi.Operator(circ) If you want the numpy array of the operator, this can be obtained via the data attribute (...


3

In qiskit, you can get the unitary transformation matrix from a quantum circuit by running the following: from qiskit import * #circuit already defined backend = Aer.get_backend('unitary_simulator') job = execute(circuit, backend) result = job.result() print(result.get_unitary(circ, decimals=3)) and the matrix will output. As you increase the number of ...


3

Try to replace backend = BasicAer.get_backend('ibmq_santiago') with backend = provider.get_backend('ibmq_santiago') Alternativetly, you can also use this code: backend = provider.backends(name = 'ibmq_santiago')[0] You have to use backends available under you account. There are only simulators in BasicAer while the real quantum machines are under the ...


3

If you decomposed your Hamiltonian into Pauli strings, and it has 100 different terms, then yes you can use one machine to do the quantum subroutine to evaluate the expectation for each of the term. $$ \langle H \rangle = \sum_{i} h_i \langle P_i \rangle $$ So you can evaluate $\langle P_1 \rangle$ on one machine and $\langle P_2 \rangle$ on another machine.....


3

Good question. I tried to figure this out as well since I saw your question without much success. However, I just wanted to point out that you can use Pennylane since it offers many external plugins so it allows you to run on many external hardware. See here: https://pennylane.ai/plugins.html You can use Qiskit and aim at multiple external devices outside of ...


2

Based on tsgeorgios information about Qiskit manual and the manual content, I created the code below which works as expected. #BASED ON: https://qiskit.org/textbook/ch-applications/hhl_tutorial.html#4.-Qiskit-Implementation %matplotlib inline # Importing standard Qiskit libraries and configuring account from qiskit import Aer from qiskit.circuit.library ...


2

The number of bits in the counts dictionary equals the number of qubits in the circuit. So in your first example, you have a 1-qubit circuit, therefore you're dictionary looks something like counts = {'0': 400, '1': 600} # for for 1000 shots counts = {'0': 1} # for 1 shot In the second example, the Jupyter notebook screenshot, you have three qubits. ...


2

Qiskit's NoiseModel class processes warnings through a logger from the logging package, not through the warnings package, so suppressing warnings as in other answers won't help. However, each method in NoiseModel provides a warnings parameter; it defaults to True but you can set it to False to prevent the warnings from being logged. Example: myNoiseModel....


2

This task can be accomplished via cirq.QasmOutput. I've attached an example of how to use the aforementioned functionality to run Cirq circuits on Qiskit's backends. import cirq from typing import Tuple from qiskit import QuantumCircuit, execute, Aer def main(): q0 = cirq.LineQubit(1) cirq_circuit = cirq.Circuit( cirq.H(q0), ...


2

The warning messages just inform you of interface change and has no impact to your code. You're submitting one job for each bit. The system uses a fair-share algorithm to determine who gets to run next (more details here: https://quantum-computing.ibm.com/docs/manage/backends/queue/). So running hundreds of jobs consecutively would kill your priority very ...


2

crx and crz are classical register. The gates CRX or CRZ mean that you apply the X gate on qubit 2 if the measurement on the classical register crx is a 1, that is if qubit 1 (q1) is in the $|1\rangle$ state; and you will apply the Z gate on qubit 2 if the classical register crz is 1. This can be done in qiskit with c_if operation. You can see example of the ...


2

The other answer is great. But here is a link that walk you through the process step-by-step: https://medium.com/mdr-inc/checking-the-unitary-matrix-of-the-quantum-circuit-on-qiskit-5968c6019a45


2

Since we are talking about a unitary operation on qubits, i assume $ d = 2^n $ where $ n $ is the number of qubits. We define the unitary operations $ V_{a} = \sum_{x=0}^{d - 1} | x + a \rangle \langle x| $ and $ D_{b} = \sum_{x=0}^{d - 1} \omega_d^{bx} | x \rangle \langle x| $. Notice that we can write $ U_{a, b} = V_a \cdot D_b $. In the Fourier basis (see ...


2

How many shots were you using? and on which device? Theoretically, you only need one shot for this algorithm, but because current devices are noisy, hence the name NISQ (Noisy Intermediate-Scale Quantum), we need to do a lot more experiments here. The maximum number of shots on IBM's machine is 8192 so I would use that. It is important to note that not all ...


1

First, note that the circuit construction using classical condition like you have is not executable on IBM hardware at the moment. Devices like Honewywell Trapped ion allows you to do such thing (I think). However, thanks to principle of deferred measurement, we can push the measurement all the way back to the end of the circuit. See here. Essentially, your ...


1

For a 3 qubit system, you might get results like 000, 010, 011 etc. but the leftmost bit of the readout will always be zero. This is how we know that the teleport has worked.


1

As the other answer stated, there is nothing wrong. The reason for long time for the job to be completed is coming from the queuing time and not the actual execution time itself. One way to get around this is to use more qubits. This way you don't have to stuck in queue multiple time. That is, you use the maximum number of qubits a particular machine has ...


1

It is in the method documentation, overwrite: Overwrite existing credentials.: IBMQ.save_account('api_token', overwrite=True)


1

I don't know what do you mean, the error specifically says that: QiskitBackendNotFoundError: "The 'ibmq_santiago' backend is not installed in your system." This means you don't have access to this machine from your account. This machine is either dedicated to only privilege users.


1

Look at the start of the multiqubit section in [1], in particular the section on basis vector ordering. I found the ordering of qubits to be very strange in qiskit possibly this is your error as well? For example the state |10> corresponds to qubit 0 being in state |0> and qubit 1 in state |1>, contrary to what you might expect [1]https://qiskit.org/...


1

To answer your question, you do not have to be on online the whole time in order for your job to run on the real hardware. If you create a job with 100 circuits and get the job_id with the command job.job_id() you can leave the IBM Quantum Experience website or shut down your computer and when you come back, you can do the following in the same or different ...


1

All jobs sent to IBMQ backends are asynchronous. You just need to save the job ID and use the ID retrieve it later. For example: provider = IBMQ.load_account() backend = provider.get_backend('ibmq_vigo') job = execute(circuits, backend) print(job.job_id()) Once the job is submitted, you can turn off your laptop. Then when you're ready to get the results, do ...


1

You first need to pip install qiskit and get your API Token from https://quantum-computing.ibm.com/account Then, save your token in your configuration: from qiskit import IBMQ IBMQ.save_account('MY_API_TOKEN') In this way, your Qiskit installation now is connected with your IBM Quantum Experience account (aka, a provider). You can list all your devices ...


1

I don't think it really matter how you index your $t_{ij}$. As you mentioned you can use FermionicOperator all you need to do is define the one body integral. This of course can be done in many ways. Here is a convenient way. def ssh_ham(gamma, lamda, n): sigmax = np.array([[0,1],[1,0]], dtype=np.complex_) sigmay = np.array([[0,-1j],[1j,0]], dtype=...


1

Yes. It seems like it is indeed adding noise to mimic the noise of Valencia. As to what kind of noise, I assuming that it takes the latest calibrated data, and incorporated the T1 errors and T2 errors along with the measurement errors too. The result will be different than the hardware run since the noise occur in the hardware is much more complicated than ...


1

By default, Qiskit visualization bundles together classical bits of the same register. If you would like to draw them separately, do qr = QuantumRegister(2) cr = ClassicalRegister(2) circ = QuantumCircuit(qr, cr) circ.draw('mpl', cregbundle=False)


Only top voted, non community-wiki answers of a minimum length are eligible