# How can I print out a state vector of a specific wire?

Suppose we start from 2 wires (q0 and q1) and through some quantum gates, suppose we measure q1 wire only.

As we measure the q1 wire, the state vector of this quantum state would be determined immediately. How can I print out this state vector?

In addition, I would like to print out the state vector of q0 wire only. Does anyone know how to do this task via qiskit or cirq or pyquil? (Any other package language is also fine!)

• Do you mean the state before or after measurement? Note that, in general, before measurement this is not possible, because the two qubits can be entangled, which is exactly saying that the state of one of the qubits cannot be described without also describing the other qubit. Furthermore, after measurement the state is just the particular state associated with the measurement outcome.
– JSdJ
Jun 24 '20 at 7:30

This task can be done using Microsoft Q#
If you have two qubits which after quantum operations are in the state $$|\psi\rangle$$, and you wish to find the state of the qubit q0 before/without measurement, You can use Q#'s DumpRegister function which will print to the console the state of your qubits.
# wave function for qubits with ids (least to most significant): 0

If you choose to Measure the qubit q0 then its state collapses to the result of your measurement.