Curriculum Reference Resources
TensorFlow Quantum (TFQ) is a quantum machine learning library for rapid prototyping of hybrid quantum-classical ML models. Research in quantum algorithms and applications can leverage Google’s quantum computing frameworks, all from within TensorFlow. TensorFlow Quantum focuses on quantum data and building hybrid quantum-classical models. It integrates quantum computing algorithms and logic designed in Cirq, and provides quantum computing primitives compatible with existing TensorFlow APIs, along with high-performance quantum circuit simulators. Read more in the TensorFlow Quantum white paper. As additional reference you can check out the overview and run the notebook tutorials.
Cirq is an open-source framework for Noisy Intermediate Scale Quantum (NISQ) computers. It was developed by the Google AI Quantum Team, and the public alpha was announced at the International Workshop on Quantum Software and Quantum Machine Learning on July 18, 2018. A demo by QC Ware showed an implementation of QAOA solving an example of the maximum cut problem being solved on a Cirq simulator. Quantum programs in Cirq are represented by "Circuit" and "Schedule" where "Circuit" represents a Quantum circuit and "Schedule" represents a Quantum circuit with timing information. The programs can be executed on local simulators. The following example shows how to create and measure a Bell state in Cirq.
import cirq # Pick qubits qubit0 = cirq.GridQubit(0, 0) qubit1 = cirq.GridQubit(0, 1) # Create a circuit circuit = cirq.Circuit.from_ops( cirq.H(qubit0), cirq.CNOT(qubit0, qubit1), cirq.measure(qubit0, key='m0'), cirq.measure(qubit1, key='m1') )
Printing the circuit displays its diagram
print(circuit) # prints # (0, 0): ───H───@───M('m0')─── # │ # (0, 1): ───────X───M('m1')───
Simulating the circuit repeatedly shows that the measurements of the qubits are correlated.
simulator = cirq.Simulator() result = simulator.run(circuit, repetitions=5) print(result) # prints # m0=11010 # m1=11010