-
Notifications
You must be signed in to change notification settings - Fork 79
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
Draw circuits with midcircuit-measurement and conditional gates #50
Comments
This is indeed a known issue, since we have no classical register concepts (which I think is a too heavy abstraction) in tensorcircuit, it is indeed hard to visualize this, especially when integrated with qiskit. Currently, one workaround to avoid the error is by adding several lines in the codebase: just ignore nonunitary gate when do the qiskit trasformation (I'll fix like this soon). Still, the obtained circuit.draw() will contain no ingredient of cond_gates, though no error raised. |
Thanks for sharing your thoughts. For now, the translation from As you described, support mid circuit measurement translation between tc and qiskit is very important for users who would like to try some hardware experiments. The difficult part is that, the measurement results is just a int Tensor, and when does this Tensor is utilized in python is hard to track in circuit intermediate representation level. Though this may be solved with some more deep thoughts and refactoring. In a word, the enhancement you suggested is worth a try and indeed helpful but the implementation is not that easy to me for now. Let's keep this issue open and see whether we can have better inputs or ideas from other developers and users |
Hi! Is there any update regarding the mid circuit measurements? My use case would be to convert a qiskit circuit to TensorCircuit, where the former contains mid circuit measurements (no classical conditional gates) |
Could you provide a minimal python demo on the qiskit circuit, i.e. which circuit object exactly you want to feed into |
Issue Description
Draw circuits with conditional gates. Currently, such attempt will raise a qiskit.extensions.exceptions.ExtensionError: 'Input matrix is not unitary.'
Proposed Solution
I am not very sure whether it is easy to implement by still using the drawing utilities of qiskit. So I do not have very good solution proposed.
Additional References
In qiskit, it is done by introducing classical registers, e.g. https://quantum-computing.ibm.com/lab/docs/iql/manage/systems/midcircuit-measurement/.
The text was updated successfully, but these errors were encountered: