New answers tagged

0

Your code looks fine - I am afraid you just were out of luck - Bogota appears to have some problems today (24th Oct 2021 as of 11 PM EST). Try switching to a different backend, like ibmq-manila or ibmq-santiago. You can check a list of all backends available to you here. On a related note, I would sincerely recommend also playing with simpler circuits at ...


0

Do you mean add a label for the gate that is controlled? If yes, you could just add it to the gate before controlling it: >>> from qiskit.circuit import QuantumCircuit >>> from qiskit.quantum_info import Operator >>> gate = Operator([[1,0],[0,1]]).to_instruction() >>> gate.label = "MyLabel" >>> cgate = ...


5

A shot is a full run of a circuit. If your circuit contains 100 measurements, sampling a shot from that circuit will produce 100 bits of measurement information. A round is a concept used by the circuit generation methods to parameterize how deep you want the generated circuit to be. Each of the generated circuits repeatedly measures some set of local ...


1

IBM Quantum Systems are calibrated daily, and the system properties update once this calibration sequence is complete. It means that your noise model could change on a daily basis. More information in the documentation: https://quantum-computing.ibm.com/lab/docs/iql/manage/systems/properties https://quantum-computing.ibm.com/admin/docs/admin/calibration-jobs


2

I expect you get the Noise Model from the calibrated data of the hardware, however I am not sure how often it is updated. I doubt that it is live or even daily. You can check the noise model by running noise_model._local_quantum_errors and noise_model._local_readout_errors For instance: device = provider.get_backend('ibmq_armonk') noise_model = NoiseModel....


2

The VQC consists of a feedback loop of quantum and classical processor, where the loss function is evaluated on a quantum computer and the classical part suggests new parameters. The number of shots is the number of samples the quantum computer does to estimate the expectation values (-> the loss function). The number of iterations is the number of times ...


0

I will try to provide you with some hints how to implement your unitary operation. Let's firstly rewrite it as $U_d = \mathrm{exp}(-i\Theta(t)\sigma_x)$ or $U_d = \mathrm{exp}(-i\Theta(t)X)$ (i.e. I replaced the notation $\sigma_x$ for Pauli $X$ gate by symbol $X$). This means that $U_d$ is in fact $x$ rotation given by formula $$ Rx(\theta)= \mathrm{exp}\...


0

I was able to setup the encoding and syndrome check for the example $[[5,1,3]]$ code. import stim circuit=stim.Circuit(''' RZ 0 1 2 3 RZ 4 H 0 CY 0 4 H 1 CX 1 4 H 2 CZ 2 0 CZ 2 1 CX 2 4 H 3 CZ 3 0 CZ 3 2 CY 3 4 MPP Y0*Z1*Z3*Y4 X1*Z2*Z3*X4 Z0*Z1*X2*X4 Z0*Z2*Y3*Y4 ''') sampler = circuit.compile_sampler() print(sampler.sample(shots=8)) The results : [[1 0 0 ...


3

As of v1.6: You can use stim.TableauSimulator.peek_observable_expectation to get this value. Before v1.6 Because Stim's C++ API is explicitly not guaranteed to be stable over time, I'm going to initially give my answer in terms of its Python API. There are a few methods you can use to determine the expected value of an observable. Probably the easiest is to ...


1

You can use the MPP instruction to measure a Pauli product. For example, if one of the prepared stabilizers is $X_1 \cdot Z_2 \cdot Y_3 = +1$ then you can do: # [... encoding circuit ... ] # measure stabilizer MPP X1*Z2*Y3 # and claim it's supposed to have a deterministic result DETECTOR rec[-1] If you now sample the detectors of the circuit via circuit....


0

Thanks to @Maria Mykhailova who pointed me to this StackOverflow question with similar symptoms. This comment (lightly edited) in one of the answers was helpful: Then there is something broken with your local NuGet cache. Empty it by removing everything inside the packages folder and then run the command dotnet restore again. While I didn't "remove ...


1

There currently isn't a controlled Pauli product gate in Stim. You have to decompose it into a series of CX, CY, and CZ gates. # Apply X1*Y2*Z3 controlled by qubit 0 CX 0 1 CY 0 2 CZ 0 3 # Apply X1*Y2*Z3 if latest measurement result was True CX rec[-1] 1 CY rec[-1] 2 CZ rec[-1] 3


2

Stim is very much a circuit focused simulator. It speaks quantum operations, not stabilizer configurations, so you have to convert your table of stabilizers into a stabilizer circuit. This is a bit inconvenient, but ultimately makes Stim much more flexible as a tool (e.g. it has no issues with gauge codes or non-foliated codes). The "proper" thing ...


2

I also suggest Xanadu's Pennylane (https://pennylane.ai/). Examples/tutorials: https://pennylane.ai/qml/demonstrations.html


1

D-Wave is the main provider of quantum annealers for the last 20 years. The company just announced its expansion into gate-based quantum systems (making it the only provider of both types at the time of this writing). https://www.dwavesys.com/company/newsroom/press-release/let-s-get-practical-d-wave-details-product-expansion-cross-platform-roadmap/ Quantum ...


2

The method stim.Tableau.random(n) generates a uniformly random n-qubit Clifford operation, using the algorithm from "Hadamard-free circuits expose the structure of the Clifford group", and returns its stabilizer tableau. example import stim t = stim.Tableau.random(10) print(repr(t)) sample output stim.Tableau.from_conjugated_generators( xs=[ ...


0

One can start with operator flow's tutorial of qiskit which can be found on this website. The Hamiltonian can be easily found. But since it's not a unitary matrix, the qiskit functions won't be able to build its corresponding circuit.


5

The matrix $$ M = \frac{1}{\sqrt{2}}\begin{bmatrix}-i & 1\\-1 & i\end{bmatrix} $$ resembles $$ X/2 = \frac{1}{\sqrt{2}}\begin{bmatrix}1 & -i\\-i & 1\end{bmatrix}\tag1 $$ where we follow the notation $\pm X/2$ for the $\pm\frac{\pi}{2}$ rotation around the $X$ axis as used in the table B.6 on page 101 in Julian Kelly's PhD thesis. We can make ...


4

For surface codes, the syndrome measurements collapse the errors into either being $X$ or $Z$ errors. All Clifford gates have easy-to-compute commutation relations with $X$ and $Z$ gates. So the idea is not to actually correct the errors, since that would require more quantum operations which are difficult and error-prone, but to simply track the errors and ...


1

Qiskit defines the $RX$ gate as follows: $$ RX(\theta) = \exp\left(-i \frac{\theta}{2} X\right) = \begin{pmatrix} \cos{\frac{\theta}{2}} & -i\sin{\frac{\theta}{2}} \\ -i\sin{\frac{\theta}{2}} & \cos{\frac{\theta}{2}} \end{pmatrix} $$ Thus, setting $\theta = \pi$, would give us: $$ RX(\pi) = \...


3

There is Qiskit Optimization application module entirely suitable for solving optimization problems as it can be noticed from the name. This module is based on Qiskit and provides high level interfaces to optimization define problems and solve them via various quantum algorithms. The module is written in python. Take a look at the module page and tutorials: ...


0

As CX gate is a two-qubit gate, therefore, the size of the matrix which represents the two-qubit gate is 4x4. That's the reason why you have to use a tensor product with two error_gate1 (2x2) to create the error gate for CX gate. For the noise model, you should create the error for all types of gates that you are using in your circuit. Moreover, usually, two-...


3

The decomposition they give is the following: $$ R_z(\theta) = R_x\left(\pi / 2\right) R_y(\theta) R_x\left(-\pi / 2\right) $$ Therefore, the Qiskit code would look like: from qiskit import QuantumCircuit from qiskit.quantum_info import Operator import numpy as np theta = np.pi / 4 qc = QuantumCircuit(1) qc.rx(-np.pi / 2, 0) qc.ry(theta, 0) qc.rx(np.pi / 2,...


2

In QuTiP, one can construct generalized dissipators with the lindblad_dissipator function listed under "Superoperators and Liouvillians" here. You can pass in separate operators to act from the left and right: \begin{align} D[a,b] = a\rho b^\dagger - \frac{1}{2}a^\dagger b \rho - \frac{1}{2} \rho a b^\dagger \end{align} Then, in the master ...


1

As mentioned by @user47787 This is yet another case of floating-point representation error at the machine level. This behaviour is language agnostic and has nothing to do with Python or Numpy or Qiskit. Related Reads: A very old post on stackoverflow discussing this issue - Is Floating Point Math broken ? Python docs describing the same - Floating Point ...


Top 50 recent answers are included