question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot serialize identity gate on Quantum Engine

See original GitHub issue

Description of the issue

Cannot serialize identity gate when using SQRT_ISWAP_GATESET.

How to reproduce the issue

sampler = engine.get_sampler(processor_id='...', gate_set=cg.SQRT_ISWAP_GATESET)
q = cirq.GridQubit(7, 4)
c = cirq.Circuit(cirq.I(q))
r = sampler.run(c, repetitions=1)
...
ValueError: Cannot serialize op cirq.I(cirq.GridQubit(7, 4)) of type <class 'cirq.ops.identity.IdentityGate'>

Cirq version

0.14.0.dev20211210220312

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
dstrain115commented, Jan 26, 2022

Confirmed with @viathor that we should just strip these gates out when serializing. Let’s do this in CircuitSerializer too. @verult

1reaction
tanujkhattarcommented, Feb 25, 2022

(we can add helper function to do this if needed).

Just FYI: We already have cirq.drop_negligible_operations transformer to achieve this.

https://github.com/quantumlib/Cirq/blob/afb62da0e33559a47135094047ce3a872740a17e/cirq-core/cirq/transformers/drop_negligible_operations.py#L26

Read more comments on GitHub >

github_iconTop Results From Across the Web

Google Cirq Gate Throws Serialization Error #200 - GitHub
We wanted to be able to serialize and deserialize circuits to protocol buffer representations when passing them between our ops (C++ protocol ...
Read more >
cirq.IdentityGate - Google Quantum AI
A Gate that perform no operation on qubits. ... diagonal and all 0s off the diagonal in any basis. cirq.I is the single...
Read more >
There seems to be a problem with the implementation of ...
There seems to be a problem with the implementation of identity gates on Qiskit as compared to the circuit composer.
Read more >
quantum Cirq 1.0 :: Triage Party
4833 · Cannot serialize identity gate on Quantum Engine. 4. 10mo, 4mo, 6mo. kind/bug-report. triage/accepted. area/serialization. priority/p2. assigned.
Read more >
Release notes - Azure Quantum | Microsoft Learn
Azure Quantum now supports CCX native gates, this fixes GitHub issue ... Problem.serialize() of the azure.quantum.optimization Python ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found