pub struct Process { /* private fields */ }Implementations§
Source§impl Process
impl Process
Sourcepub fn new(configuration: Configuration) -> Self
pub fn new(configuration: Configuration) -> Self
Examples found in repository?
examples/mcx.rs (line 44)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
fn main() -> Result<(), KetError> {
set_log_level(4);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(vec![
(0, 4),
(0, 1),
(1, 2),
(1, 5),
(2, 3),
(2, 6),
(3, 7),
(4, 8),
(4, 5),
(5, 9),
(5, 6),
(6, 10),
(6, 7),
(7, 11),
(8, 9),
(9, 10),
(10, 11),
]),
12,
Default::default(),
Default::default(),
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 6;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
ctrl(&mut process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})?;
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("Instructions:");
for line in process.instructions() {
println!("\t{:?}", line);
}
println!("ISA Instructions:");
if let Some(isa) = process.isa_instructions() {
for line in isa {
println!("\t{:?}", line);
}
}
Ok(())
}More examples
examples/grover.rs (line 28)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
fn main() -> Result<(), KetError> {
set_log_level(3);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(ket::ex_arch::GRID12.to_vec()),
12,
U2Gates::RzSx,
U4Gate::CZ,
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 8;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
let steps = ((FRAC_PI_4) * f64::sqrt((1 << size) as f64)) as i64;
for _ in 0..steps {
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
}
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("{:#?}", process.metadata());
Ok(())
}Sourcepub fn alloc(&mut self) -> Result<LogicalQubit>
pub fn alloc(&mut self) -> Result<LogicalQubit>
Examples found in repository?
examples/mcx.rs (line 48)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
fn main() -> Result<(), KetError> {
set_log_level(4);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(vec![
(0, 4),
(0, 1),
(1, 2),
(1, 5),
(2, 3),
(2, 6),
(3, 7),
(4, 8),
(4, 5),
(5, 9),
(5, 6),
(6, 10),
(6, 7),
(7, 11),
(8, 9),
(9, 10),
(10, 11),
]),
12,
Default::default(),
Default::default(),
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 6;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
ctrl(&mut process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})?;
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("Instructions:");
for line in process.instructions() {
println!("\t{:?}", line);
}
println!("ISA Instructions:");
if let Some(isa) = process.isa_instructions() {
for line in isa {
println!("\t{:?}", line);
}
}
Ok(())
}More examples
examples/grover.rs (line 32)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
fn main() -> Result<(), KetError> {
set_log_level(3);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(ket::ex_arch::GRID12.to_vec()),
12,
U2Gates::RzSx,
U4Gate::CZ,
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 8;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
let steps = ((FRAC_PI_4) * f64::sqrt((1 << size) as f64)) as i64;
for _ in 0..steps {
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
}
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("{:#?}", process.metadata());
Ok(())
}Sourcepub fn gate(&mut self, gate: QuantumGate, target: LogicalQubit) -> Result<()>
pub fn gate(&mut self, gate: QuantumGate, target: LogicalQubit) -> Result<()>
Examples found in repository?
examples/mcx.rs (line 50)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
fn main() -> Result<(), KetError> {
set_log_level(4);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(vec![
(0, 4),
(0, 1),
(1, 2),
(1, 5),
(2, 3),
(2, 6),
(3, 7),
(4, 8),
(4, 5),
(5, 9),
(5, 6),
(6, 10),
(6, 7),
(7, 11),
(8, 9),
(9, 10),
(10, 11),
]),
12,
Default::default(),
Default::default(),
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 6;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
ctrl(&mut process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})?;
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("Instructions:");
for line in process.instructions() {
println!("\t{:?}", line);
}
println!("ISA Instructions:");
if let Some(isa) = process.isa_instructions() {
for line in isa {
println!("\t{:?}", line);
}
}
Ok(())
}More examples
examples/grover.rs (line 35)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
fn main() -> Result<(), KetError> {
set_log_level(3);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(ket::ex_arch::GRID12.to_vec()),
12,
U2Gates::RzSx,
U4Gate::CZ,
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 8;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
let steps = ((FRAC_PI_4) * f64::sqrt((1 << size) as f64)) as i64;
for _ in 0..steps {
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
}
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("{:#?}", process.metadata());
Ok(())
}pub fn global_phase(&mut self, angle: f64) -> Result<()>
pub fn measure(&mut self, qubits: &[LogicalQubit]) -> Result<usize>
Sourcepub fn sample(&mut self, qubits: &[LogicalQubit], shots: usize) -> Result<usize>
pub fn sample(&mut self, qubits: &[LogicalQubit], shots: usize) -> Result<usize>
Examples found in repository?
examples/mcx.rs (line 53)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
fn main() -> Result<(), KetError> {
set_log_level(4);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(vec![
(0, 4),
(0, 1),
(1, 2),
(1, 5),
(2, 3),
(2, 6),
(3, 7),
(4, 8),
(4, 5),
(5, 9),
(5, 6),
(6, 10),
(6, 7),
(7, 11),
(8, 9),
(9, 10),
(10, 11),
]),
12,
Default::default(),
Default::default(),
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 6;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
ctrl(&mut process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})?;
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("Instructions:");
for line in process.instructions() {
println!("\t{:?}", line);
}
println!("ISA Instructions:");
if let Some(isa) = process.isa_instructions() {
for line in isa {
println!("\t{:?}", line);
}
}
Ok(())
}More examples
examples/grover.rs (line 76)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
fn main() -> Result<(), KetError> {
set_log_level(3);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(ket::ex_arch::GRID12.to_vec()),
12,
U2Gates::RzSx,
U4Gate::CZ,
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 8;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
let steps = ((FRAC_PI_4) * f64::sqrt((1 << size) as f64)) as i64;
for _ in 0..steps {
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
}
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("{:#?}", process.metadata());
Ok(())
}pub fn exp_value( &mut self, hamiltonian: Hamiltonian<LogicalQubit>, ) -> Result<usize>
pub fn dump(&mut self, qubits: &[LogicalQubit]) -> Result<usize>
Sourcepub fn transpile(&mut self)
pub fn transpile(&mut self)
Examples found in repository?
examples/mcx.rs (line 54)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
fn main() -> Result<(), KetError> {
set_log_level(4);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(vec![
(0, 4),
(0, 1),
(1, 2),
(1, 5),
(2, 3),
(2, 6),
(3, 7),
(4, 8),
(4, 5),
(5, 9),
(5, 6),
(6, 10),
(6, 7),
(7, 11),
(8, 9),
(9, 10),
(10, 11),
]),
12,
Default::default(),
Default::default(),
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 6;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
ctrl(&mut process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})?;
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("Instructions:");
for line in process.instructions() {
println!("\t{:?}", line);
}
println!("ISA Instructions:");
if let Some(isa) = process.isa_instructions() {
for line in isa {
println!("\t{:?}", line);
}
}
Ok(())
}More examples
examples/grover.rs (line 77)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
fn main() -> Result<(), KetError> {
set_log_level(3);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(ket::ex_arch::GRID12.to_vec()),
12,
U2Gates::RzSx,
U4Gate::CZ,
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 8;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
let steps = ((FRAC_PI_4) * f64::sqrt((1 << size) as f64)) as i64;
for _ in 0..steps {
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
}
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("{:#?}", process.metadata());
Ok(())
}pub fn execute(&mut self) -> Result<()>
pub fn get_measure(&self, index: usize) -> Option<u64>
pub fn get_sample(&self, index: usize) -> Option<&Sample>
pub fn get_exp_value(&self, index: usize) -> Option<f64>
pub fn get_dump(&self, index: usize) -> Option<&DumpData>
pub fn ctrl_push(&mut self, qubits: &[LogicalQubit]) -> Result<()>
pub fn ctrl_pop(&mut self) -> Result<()>
pub fn adj_begin(&mut self) -> Result<()>
pub fn adj_end(&mut self) -> Result<()>
pub fn ctrl_begin(&mut self) -> Result<()>
pub fn ctrl_end(&mut self) -> Result<()>
Sourcepub fn instructions(&self) -> &[Instruction<LogicalQubit>]
pub fn instructions(&self) -> &[Instruction<LogicalQubit>]
Examples found in repository?
examples/mcx.rs (line 57)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
fn main() -> Result<(), KetError> {
set_log_level(4);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(vec![
(0, 4),
(0, 1),
(1, 2),
(1, 5),
(2, 3),
(2, 6),
(3, 7),
(4, 8),
(4, 5),
(5, 9),
(5, 6),
(6, 10),
(6, 7),
(7, 11),
(8, 9),
(9, 10),
(10, 11),
]),
12,
Default::default(),
Default::default(),
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 6;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
ctrl(&mut process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})?;
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("Instructions:");
for line in process.instructions() {
println!("\t{:?}", line);
}
println!("ISA Instructions:");
if let Some(isa) = process.isa_instructions() {
for line in isa {
println!("\t{:?}", line);
}
}
Ok(())
}pub fn instructions_json(&self) -> String
Sourcepub fn isa_instructions(&self) -> Option<&[Instruction<PhysicalQubit>]>
pub fn isa_instructions(&self) -> Option<&[Instruction<PhysicalQubit>]>
Examples found in repository?
examples/mcx.rs (line 62)
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
fn main() -> Result<(), KetError> {
set_log_level(4);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(vec![
(0, 4),
(0, 1),
(1, 2),
(1, 5),
(2, 3),
(2, 6),
(3, 7),
(4, 8),
(4, 5),
(5, 9),
(5, 6),
(6, 10),
(6, 7),
(7, 11),
(8, 9),
(9, 10),
(10, 11),
]),
12,
Default::default(),
Default::default(),
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 6;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
ctrl(&mut process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})?;
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("Instructions:");
for line in process.instructions() {
println!("\t{:?}", line);
}
println!("ISA Instructions:");
if let Some(isa) = process.isa_instructions() {
for line in isa {
println!("\t{:?}", line);
}
}
Ok(())
}pub fn isa_instructions_json(&self) -> String
Sourcepub fn metadata(&self) -> Metadata
pub fn metadata(&self) -> Metadata
Examples found in repository?
examples/grover.rs (line 79)
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82
fn main() -> Result<(), KetError> {
set_log_level(3);
let config = Configuration {
num_qubits: 12,
qpu: Some(QPU::new(
// 0--1--2--3
// | | | |
// 4--5--6--7
// | | | |
// 8--9--A--B
Some(ket::ex_arch::GRID12.to_vec()),
12,
U2Gates::RzSx,
U4Gate::CZ,
)),
..Default::default()
};
let mut process = Process::new(config);
let size = 8;
let qubits: Vec<_> = (0..size).map(|_| process.alloc().unwrap()).collect();
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
let steps = ((FRAC_PI_4) * f64::sqrt((1 << size) as f64)) as i64;
for _ in 0..steps {
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
around(
&mut process,
|process| {
for qubit in &qubits {
process.gate(QuantumGate::Hadamard, *qubit)?;
}
for qubit in &qubits {
process.gate(QuantumGate::PauliX, *qubit)?;
}
Ok(())
},
|process| {
ctrl(process, &qubits[1..], |process| {
process.gate(QuantumGate::PauliZ, qubits[0])
})
},
)?;
}
let _ = process.sample(&qubits, 1024)?;
process.transpile();
println!("{:#?}", process.metadata());
Ok(())
}Trait Implementations§
Auto Trait Implementations§
impl Freeze for Process
impl !RefUnwindSafe for Process
impl !Send for Process
impl !Sync for Process
impl Unpin for Process
impl !UnwindSafe for Process
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more