Updated the qubit scaling example starting at line 263 (#78)
Updated the qubit scaling example starting at line 263 (#78)

Previously the length of a wavefunction object was the number of amplitudes and now it returns the number of qubits.

REPLACED
print "The quantum state is of dimension:", len(quantum_simulator.wavefunction(p)[0])
WITH
wvf, _ = quantum_simulator.wavefunction(p)
print "The quantum state is of dimension:", len(wvf.amplitudes)

# OLD
# Multiple qubits also produce the expected scaling of the state.
p = Program(I(0), I(1))
print "The quantum state is of dimension:", len(quantum_simulator.wavefunction(p)[0])

p = Program(I(0), I(1), I(2), I(3))
print "The quantum state is of dimension:", len(quantum_simulator.wavefunction(p)[0])

p = Program()
for x in range(10):
    p.inst(I(x))
print "The quantum state is of dimension:", len(quantum_simulator.wavefunction(p)[0])

# NEW
# Multiple qubits also produce the expected scaling of the state.
p = Program(I(0), I(1))
wvf, _ = quantum_simulator.wavefunction(p)
print "The quantum state is of dimension:", len(wvf.amplitudes)

p = Program(I(0), I(1), I(2), I(3))
wvf, _ = quantum_simulator.wavefunction(p)
print "The quantum state is of dimension:", len(wvf.amplitudes)

p = Program()
for x in range(10):
    p.inst(I(x))
wvf, _ = quantum_simulator.wavefunction(p)
print "The quantum state is of dimension:", len(wvf.amplitudes)
rigetticomputing/pyquil