File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed
Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -4,15 +4,10 @@ use anyhow::Result;
44use simple_qsim:: { circuit:: GateKind , Circuit , QState } ;
55
66fn main ( ) -> Result < ( ) > {
7- let num_of_qubits = 3 ;
7+ let num_of_qubits = 8 ;
88
99 let mut circuit = Circuit :: new ( num_of_qubits) ;
1010
11- // Initialize input with H
12- for i in 0 ..num_of_qubits {
13- circuit. add_gate ( GateKind :: H , i) ;
14- }
15-
1611 for i in ( 0 ..num_of_qubits) . rev ( ) {
1712 circuit. add_gate ( GateKind :: H , i) ;
1813 for j in ( 0 ..i) . rev ( ) {
@@ -21,9 +16,7 @@ fn main() -> Result<()> {
2116 }
2217 }
2318
24- println ! ( "Circuit:\n {}" , circuit) ;
25-
26- let qs = QState :: from_str ( "000" ) ?;
19+ let qs = QState :: zero_state ( num_of_qubits) ;
2720
2821 let result = circuit. apply ( & qs) ?;
2922 println ! ( "Resulting state:\n {}" , result) ;
You can’t perform that action at this time.
0 commit comments