Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ionq as qutip provider #216

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

add ionq as qutip provider #216

wants to merge 7 commits into from

Conversation

splch
Copy link

@splch splch commented Sep 2, 2023

adds ionq as a provider for interoperability with qutip-qip

from qutip.qip.circuit import QubitCircuit
from qutip_qip.ionq import Provider, IonQSimulator

# QuTiP Circuit
qc = QubitCircuit(N=2)
qc.add_gate("H", targets=0)
qc.add_gate("CNOT", controls=1, targets=0)

# IonQ Integration
provider = Provider()
backend = IonQSimulator(provider=provider)

job = backend.run(qc)
results = job.get_results()
print(results.get_final_states())
[Quantum object: dims = [[2, 2], [1, 1]], shape = (4, 1), type = ket
Qobj data =
[[1.]
 [0.]
 [0.]
 [0.]], Quantum object: dims = [[2, 2], [1, 1]], shape = (4, 1), type = ket
Qobj data =
[[0.]
 [0.]
 [0.]
 [1.]]]
  • create jobs from qutip circuits
  • use CircuitResult object to parse results

@hodgestar
Copy link
Contributor

@splch Let us know when you would like a review.

Would it be possible to add some tests similar to the ones in https://github.com/qutip/qutip-qip/blob/master/tests/test_qiskit.py?

@hodgestar
Copy link
Contributor

@splch How are you getting along with this?

@splch
Copy link
Author

splch commented Oct 9, 2023

hey! sorry i havent made much progress - im working on this independently from work so it's harder to find time. i definitely plan on continuing work on this integration though

@hodgestar
Copy link
Contributor

Thanks & no worries. What is your overall plan?

@hodgestar
Copy link
Contributor

@splch Sorry for being a pain, but could you remove the demo notebook with output from the branch and perhaps replace it with a test or documentation addition? It's a small thing, but if large outputs accidentally get committed it hard to remove them from history later.

@hodgestar
Copy link
Contributor

@splch Sorry for being a pain, but could you remove the demo notebook with output from the branch and perhaps replace it with a test or documentation addition? It's a small thing, but if large outputs accidentally get committed it hard to remove them from history later.

P.S. Posting this straight away so that hopefully it's easy to just force push the removal to your branch because there aren't many commits on top of it.

@splch
Copy link
Author

splch commented Mar 19, 2024

ah yeah no problem! sorry for not seeing this earlier :) ill remove it now

@splch
Copy link
Author

splch commented Mar 20, 2024

@hodgestar im trying to use the CircuitResult object as the result from the job. but i see it uses a list of density matrices to be initialized - is there some documentation you know of that can help me convert:

{'0': 0.5, '3': 0.5}

into a list of qobjs?

currently im doing: https://github.com/qutip/qutip-qip/pull/216/files#diff-dca8c04466f14c3fc623bb06f1546485896ef77c2fcafd4723b9b641493e0c19R37-R74
but feel like there should be a better way

@splch splch marked this pull request as ready for review March 20, 2024 16:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants