Skip to content

Commit

Permalink
Fix: import paths in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
notmgsk committed Jul 17, 2021
1 parent 6eca546 commit 4ee5cd1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 7 additions & 6 deletions src/gates/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,12 @@ mod tests {
use ndarray::arr2;
use pretty_assertions::assert_eq;

use crate::gates::standard::{cnot, x};
use crate::matrix::{C0, C1};

#[test]
fn lift_1q() {
let gate = super::x(0);
let gate = x(0);
assert_eq!(
gate.lift_adjacent(0, 2),
arr2(&[
Expand All @@ -109,7 +110,7 @@ mod tests {
])
);

let gate = super::x(1);
let gate = x(1);
assert_eq!(
gate.lift_adjacent(1, 2),
arr2(&[
Expand All @@ -128,7 +129,7 @@ mod tests {

#[test]
fn lift_2q() {
let gate = super::cnot(0, 1);
let gate = cnot(0, 1);
assert_eq!(
gate.lift(2),
arr2(&[
Expand All @@ -139,7 +140,7 @@ mod tests {
])
);

let gate = super::cnot(1, 0);
let gate = cnot(1, 0);
assert_eq!(
gate.lift(2),
arr2(&[
Expand All @@ -150,7 +151,7 @@ mod tests {
])
);

let gate = super::cnot(0, 2);
let gate = cnot(0, 2);
assert_eq!(
gate.lift(3),
arr2(&[
Expand All @@ -165,7 +166,7 @@ mod tests {
])
);

let gate = super::cnot(2, 0);
let gate = cnot(2, 0);
assert_eq!(
gate.lift(3),
arr2(&[
Expand Down
4 changes: 1 addition & 3 deletions src/matrix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ pub fn instruction_matrix(instruction: Instruction) -> Result<QGate, Instruction

#[cfg(test)]
pub mod test {
use crate::gates::QGate;
use crate::matrix::{instruction_matrix, InstructionMatrixError};
use crate::matrix::instruction_matrix;
use quil::expression::Expression;
use quil::expression::Expression::Address;
use quil::instruction::{Instruction, Qubit};

#[test]
Expand Down

0 comments on commit 4ee5cd1

Please sign in to comment.