Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
A python framework for creating, editing, and invoking Noisy Intermediate Scale Quantum (NISQ) circuits. It is a Python library for writing, manipulating, and optimizing quantum circuits and running them against quantum computers and simulators.
2
votes
How do I create my own unitary matrices that I can apply to a circuit in Cirq?
The other answers seem outdated, so here is an answer written for Cirq v0.7.0. Applying a unitary matrix is basically constructing a custom gate, and a simple example for a qubit is shown below. … import cirq
import numpy as np
class QubitPlusGate(cirq.SingleQubitGate):
def _unitary_(self):
# Our input is q = a[0] + b[1]
# And our output becomes q = b[0] + a[1]
return …