Questions tagged [programming]

For questions relating to the process of assembling quantum programs that can be executed on a quantum computer. For questions using or about a specific programming language, consider using a more specific tag

Filter by
Sorted by
Tagged with
0
votes
0answers
9 views

Error parameters from Qiskit backends

In order to build a custom noise model in Qiskit Aer, I requested the error parameters from different backends and got 3 (9) parameters for each single-qubit (two-qubit) gate as output. However, I ...
0
votes
0answers
22 views

Finding minimum with Grover

I am a beginner in quantum computing. I have already computed the sat quantum solver with Grover search and then, I would like to compute the "minimum search" of Dür and Hoyer. My question is: Is it ...
4
votes
1answer
42 views

What exactly does it mean to embed classical data into a quantum state?

As the title states. I am a Machine Learning Engineer with a background in physics & engineering (post-secondary degrees). I am reading the Tensorflow Quantum paper. They say the following within ...
0
votes
0answers
36 views

Projects to join?

Learning more about tfq and quantum computing technology. Coming from an interest in ML. Any advice on how to contribute/ spectate a quantum machine learning project. Any advice on how to pursue my ...
2
votes
0answers
18 views

A bug during CIRQ installation

I had the following problem with an installation of the Cirq. When I typed python -m pip install cirq, I got the following line: "Cannot uninstall 'sympy'. It is ...
-1
votes
0answers
17 views

Problem in installing Q# [duplicate]

I have followed all steps described in https://docs.microsoft.com/en-us/quantum/install-guide/qjupyter But I am unable to get through part 3. It is showing syntax error in Python terminal in Jupyter ...
1
vote
0answers
68 views

Installing Q# in jupyter

I have followed all steps described in https://docs.microsoft.com/en-us/quantum/install-guide/qjupyter But I am unable to get through part 3. It is showing syntax error in Python terminal in Jupyter ...
1
vote
0answers
31 views

How can I run programs in test folder Github Qiskit

I am new to GitHub/Python - please tell me how can I run programs in https://github.com/Qiskit/qiskit-aqua/tree/master/test and its sub directories in Jupyter. I am connected to IBM Q Expereince. I am ...
1
vote
2answers
60 views

May I deploy my C# code to Q# Azure quantum computing?

I have a code like this ...
-1
votes
0answers
22 views

Can we use the process of recursion in predicting the future process?

Because while recursion we tend to find the possible result of a current problem by going into its future state through recursion and sometimes by means of through memorization. Then why can't we use ...
1
vote
1answer
31 views

In Qiskit, where is the floating point operation performed?

I am using Qiskit - the simple circuits I am writing can either run on the hardware backend (using least_busy) or the QASM simulator backend. If I have statements like the following - (...
0
votes
0answers
45 views

Understanding SGD on a Quantum Circuit

I implemented the following circuit, a very simple circuit: I applied the technique presented on Farhi's paper - which I am so happy people in here are talking about more and more ! - and applied to ...
1
vote
0answers
14 views

Numerical methods for finding an eigen basis of a degenerate Liouvillian

I'm trying to find the steady-state of a master equation, $$\dot{\rho}(t) = \mathcal{L}\rho(t),\tag{1}\label{1}$$ In the form where we vectorise the density matrix and matrixify (??) the Liouvillian ...
2
votes
1answer
46 views

How to calculate the Von Neuman entropy on qiskit with the module quantum_info?

I am trying to wrap my head around he quantum_info module on qiskit, since most of the functions on qiskit.tools are going to be ...
-2
votes
0answers
56 views

How to solve error AttributeError: 'numpy.ndarray' object has no attribute 'keys' in Qiskit? [closed]

I obtained error shown below. Does anybody know what does it mean and how to solve it? ...
0
votes
0answers
29 views

State fidelity in Qiskit

Can someone provide me an example for finding state fidelity of two circuits? For example, if I have a Toffoli gate with two different approaches of decomposition then how do I calculate fidelity ...
4
votes
1answer
321 views

How can I get the entire histogram in a 5 qubit program done in IBM quantum experience machine?

I have run a program on an IBM quantum experience machine which involves 5 qubits. Obviously when I measure the whole system I have 32 results but the machine only represents 20 in the histogram. In ...
2
votes
1answer
54 views

symbolic quantum computing using sympy : how to use arbitrary gate?

I'm trying to use sympy to compute symbolic results of quantum circuits using dirac notation. More specifically, I'd like to use the three rotation gates. I try to implement them in the following way,...
2
votes
0answers
16 views

How can I implement partial transpose on a variable in Picos (Python, trying to solve an SDP)?

I try to optimise a quantity via an SDP. I optimise over all PPT measurement operators and hence have the constraints $\Pi_k^{T_B} \succeq 0$ (PPT) for my measurement operators. The part of the code ...
2
votes
1answer
130 views

How to use external .csv data file in quantum support vector machine qiskit python code?

I am new to python programming and Qiskit. I would like to ask can we use sklearn for adding external .csv data file before Qiskit libraries, or without sklearn, we can do or is there any other Qiskit ...
3
votes
1answer
136 views

Why I am getting transpilation error while executing the following IBM Quantum Experience code?

While executing the following circuit (consisting 16 qubit and 4 classical bits) I am getting "Error in transpilation process. [1003]" error. I have a group of 2 operations (you can observe circuit ...
1
vote
1answer
41 views

IBMQ: `from qiskit import QISKitError` gives 'cannot import name QISKitError'

When I run: from qiskit import QISKitError I get the error: ImportError: cannot import name 'QISKitError' I need ...
2
votes
1answer
172 views

How to make circuit for randomly selected gate?

I am trying to make a circuit for the randomly selected gates from a gate_list but I don't know how to put these selected gates in front of ...
1
vote
0answers
40 views

Implementing QFT

I would like to know if there is a way to: Implement Quantum 'Functions' e.g the QFT of QFT* containing several single-qubit operations? Implement such operations on an arbitrary number of qubits and ...
1
vote
1answer
32 views

What are the different ways of representing unitary gates in terms of the matrix?

What are the different ways of representing unitary gates in terms of the matrix? In other words what would be the two different matrices which on multiplication give you unitary gate matrix?
0
votes
1answer
33 views

How to retrieve the parameters of a Q# operation?

I have a program that detects the methods and their corresponding parameters types of the classes in a namespace. Following is the C# class I have written: ...
2
votes
0answers
51 views

How to decompose arbitrary gates in Qiskit? [duplicate]

I have been exploring quantum computing, I have no idea of decomposing arbitrary gates in Qiskit. Can someone help me with an example?
1
vote
0answers
96 views

Decomposition of an arbitrary gate using given matrix in Qiskit

If I have an arbitrary non-unitary matrix of say $$ U = \begin{pmatrix} 1.5 & 0 & 0 & 0 \\ 0 & 0 & 0 & 1.6 \\ 0 & 0 & 1 & 0 \\ 0 & 1 & 0 & 0 \\ \end{...
0
votes
1answer
149 views

Installing qiskit with `pip install qiskit` gives `ERROR: Command errored out with exit status 1`

I have created a virtual environment by virtualenv (not conda) and tried to install qiskit by: ...
2
votes
1answer
44 views

How to encode eigenvalues of matrix $A$ in solving $A\vec{x} = \vec{b}$ using the HHL Algorithm

I am trying to implement multiple parallel subroutines of HHL algorithm, each working on a different set of matrix $A$ (when solving for $x$, in $A\vec{x} = \vec{b}$), to find the expectation values ...
9
votes
2answers
2k views

Does quantum computing already possess the level of abstraction to be explicable even without knowledge of physics?

Currently, quantum computer science (in contrast to classical computer science) can mostly only be understood if one has a good inside knowledge of physics, or more precisely quantum physics. Only ...
1
vote
1answer
37 views

Strange Behaviour of MeSolve, McSolve

I'm using Qutip to plot some basic two level dynamics using hamiltonians with a temporal envelope defined as the sum of two error functions, designed to make it more representative of experimental ...
0
votes
2answers
138 views

'IBMQFactory' object has no attribute 'load_accounts'

I am following this qiskit workshop from https://colab.research.google.com/github/mtreinish/qiskit-workshop/blob/master/Workshop.ipynb . After adding my API key I had encountered the error ...
1
vote
0answers
38 views

Can two intrinsic angular momentum directions (spin) be used for future entanglement after collapse? [closed]

Persuant to all contributors, here I will use a coin toss analogy since the vector direction is either up or down (heads or tails). Two coins will be used for each of two tosses. It's assumed that the ...
1
vote
0answers
93 views

IBM qiskit vs Microsoft QDK [closed]

I am new to both IBM Qiskit and Microsoft QDK. I wish to understand which framework would be best suited for someone new to this field. I am lookig for the pros and cons of both frameworks.
3
votes
0answers
38 views

Does anyone have any really good quantum computing illustration packages or frameworks for visually teaching various aspects of QC?

I'm focusing on training non quantum physics / non math majors - software engineers to be specific (and the interested senior executive that wonders by) and am bewildered by the lack of adequate ...
0
votes
0answers
56 views

Q# code for making any two qubits entangled

Suppose there are two different qubits and both with different superposition states. What is the Q# code for making these two qubits entangled?
4
votes
1answer
54 views

Logical Explanation behind second reflection in Grover's algorithm

Logically, what does the second reflection in Grover's algorithm do? I currently don't have a lot of background in linear algebra so I'm failing to understand what exactly its purpose is and what it ...
0
votes
0answers
57 views

How to reduce the length of Q# programs execution time?

In the released Q# documentation by Microsoft available at: Quantum Development Kit Full State Simulator, it is written By default OpenMP uses all available hardware threads, which means that ...
2
votes
2answers
91 views

Is it possible to create a Q# operation with optional parameters?

In C# it is possible to have: public void Fun (int n = 0){ // ... } then the following method call examples will be compiled: ...
1
vote
1answer
54 views

OPENQASM: How to include my own libraries

I studied the OPENQASM 2.0 spec a few times but failed to find a way to include my own libraries. Have I missed anything? Right now, the only way is to use ...
3
votes
1answer
102 views

How to invoke a C# method inside a Q# operation?

Suppose there is a Q# operation as follows: operation Op () : Bool { let result = CSharpMethod (); return result } where ...
1
vote
1answer
50 views

IBM Quantum Experience API Without QISKit

I am a computer science master's student who is doing research in the field of quantum computing. I have an IBM quantum experience account(https://quantum-computing.ibm.com/) and as such I was ...
2
votes
1answer
74 views

Monty Hall Problem in Quantum Computing

Is it possible to make a quantum Monty Hall problem where the quantum computer wins the game always?
2
votes
2answers
90 views

Are there any testing framework for quantum programs?

Has any testing framework been introduced to verify and also validate the quantum programs? I know Q# supports creating unit tests for quantum programs (within xUnit framework) but I do not know about ...
1
vote
1answer
75 views

Computing circuit depth in Cirq

I ran into a problem of how to extract circuit depth from Cirq circuit object. In Cirq circuits consist of a list of Moments. Number of moments is not equal to the circuit depth in general case. I ...
4
votes
1answer
88 views

What is the corresponding code for finding the state of a qubit on the Bloch sphere?

To find the state of a qubit on the Bloch sphere we use the following formula: \begin{equation} |\psi\rangle=\mathrm{cos}\frac{\theta}{2}|0\rangle+\mathrm{e}^{i\phi}\mathrm{sin}\frac{\theta}{2}|1\...
2
votes
1answer
74 views

Is it possible to write a Q# teleportation code which returns a qubit?

In the teleportation codes I have found so far from Microsoft, the codes are written based on returning the bool values but I wonder if in teleportation process, ...
1
vote
1answer
65 views

AttributeError: 'Result' object has no attribute 'get_data'

Below is the code that I am trying to execute on Google Colab using Qiskit. I'll also paste the error that I am getting. Code ...
3
votes
1answer
124 views

Custom gates on IBM Q

I realized that QASM supports custom gates. However, when I tried to create the gate, transpiling error appeared both on simulator and real quantum processor. I suspect that IBM has not implemented ...

1
2 3 4 5 6