i try to create a Custome GateSet with the CompilationTargetGateset class but it does not work.

cirq.convert_to_target_gateset(circuit, gateset=cirq.CompilationTargetGateset([cirq.rx,cirq.ry,cirq.ry,cirq.PhasedXZGate, cirq.CNOT]))

I tried to define a gate set with rotations in all directions, a phase gate and a CNOT. This should be a universal GateSet.

This is the error i get:

TypeError: Can't instantiate abstract class CompilationTargetGateset with abstract methods decompose_to_target_gateset, num_qubits

EDIT: Alright i found a code Example in the cirq repository here: https://github.com/quantumlib/Cirq/blob/v1.0.0/cirq-core/cirq/transformers/target_gatesets/compilation_target_gateset_test.py

Now my following question is how do i apply this to my problem. I don't know how to define a Gateset.



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.