Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ qfunc initial_state_projector(state: qnum, aux: qbit) {

qperm arith_equation(state: OracleVars, res: qbit) {
// Mark assignments satisfying:
// (a + b = 3) ∧ (c − a = 2)
res ^= ((state.a + state.b) == 3)
and ((state.c - state.a) == 2);
}
Expand Down
4 changes: 0 additions & 4 deletions algorithms/foundational/deutsch_jozsa/deutsch_jozsa.qmod
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,6 @@ qfunc deutsch_jozsa(predicate: qfunc (qnum, qbit), x: qnum) {

qperm complex_predicate(const x: qnum, res: qbit) {
// A non-trivial Boolean predicate on x ∈ {0,…,7}.
//
// The expression mixes bitwise (XOR, AND) and arithmetic operations:
// f(x) = 1 iff max(x ⊕ 4, x ∧ 3) ≥ 4.
//
// For 3-bit inputs, this predicate evaluates to 1 on exactly half
// of the inputs and to 0 on the other half, and is therefore balanced.
res ^= max(x ^ 4, x & 3) >= 4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ qstruct QsvtState {

// Full 8×8 block-encoding unitary U_A.
// The top-left 4×4 block encodes the matrix A.
// For the purpose of this example, U_A is just a randomly chosen unitary.
block_encoding_unitary: real[][] = [
[ -0.053380021089, -0.361036621078, -0.540164887303, -0.390261254587, -0.313105755143, 0.143054978107, -0.292038063153, -0.467904913724 ],
[ -0.333041206855, 0.106482281854, 0.373467040749, -0.339779162196, -0.587944254838, -0.023276508074, 0.510972549854, -0.124516582304 ],
Expand All @@ -35,7 +36,7 @@ b_amplitudes: real[] = [
0.801783725737
];

// Phase sequence implementing an approximation to 1/(2*kappa*x) via QSVT.
// Phase sequence implementing an approximation to 1/(2*kappa*x) via QSVT (computed using qsvt_phases function).
inversion_phase_seq: real[] = [
3.141592744052, 3.141592282568, 3.141593908377, 3.141589440915,
3.141600038975, 3.141577789821, 3.141620261336, 3.141546003685,
Expand Down