Skip to content

Commit 61a26a2

Browse files
committed
Update some files
1 parent a8b24f4 commit 61a26a2

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ fn main() {
4343
println!("N: {} (a: {}, t: {})", n, a, t);
4444

4545
let mut qsim = quantum::Q::new();
46-
let r0 = qsim.zero_with(t);
46+
let r0 = qsim.zeros(t);
4747
let r1 = qsim.zero_log2(n);
4848

4949
qsim.x(&[r1[r1.len() - 1]]);

src/quantum.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ impl Q {
6363
self.add(vec![Complex::new(1.0, 0.0), Complex::new(0.0, 0.0)])
6464
}
6565

66-
pub fn zero_with(&mut self, n: u32) -> Vec<u32> {
66+
pub fn zeros(&mut self, n: u32) -> Vec<u32> {
6767
let mut list = vec![];
6868

6969
for _ in 0..n {
@@ -75,7 +75,7 @@ impl Q {
7575

7676
pub fn zero_log2(&mut self, n: u32) -> Vec<u32> {
7777
let log2n = ((n as f64).log2() as u32) + 1;
78-
self.zero_with(log2n)
78+
self.zeros(log2n)
7979
}
8080

8181
fn tensor(&mut self, qb: Qubit) {
@@ -333,7 +333,7 @@ fn test_is_eigen_vector() {
333333
let t = 3;
334334

335335
let mut qsim = Q::new();
336-
let r0 = qsim.zero_with(t);
336+
let r0 = qsim.zeros(t);
337337
let r1 = qsim.zero_log2(n);
338338

339339
qsim.x(&[r1[r1.len() - 1]]);

0 commit comments

Comments
 (0)