Skip to content

Commit

Permalink
it....works
Browse files Browse the repository at this point in the history
  • Loading branch information
sezna committed Aug 13, 2024
1 parent 04c67b8 commit caa1d82
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 127 deletions.
4 changes: 2 additions & 2 deletions compiler/qsc/src/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

use miette::{Diagnostic, Report};
use qsc_data_structures::{language_features::LanguageFeatures, target::TargetCapabilityFlags};
pub use qsc_frontend::compile::Dependencies as Foo;
pub use qsc_frontend::compile::Dependencies;
use qsc_frontend::{
compile::{CompileUnit, PackageStore, SourceMap},
error::WithSource,
Expand Down Expand Up @@ -44,7 +44,7 @@ pub enum ErrorKind {
#[allow(clippy::module_name_repetitions)]
pub fn compile_ast(
store: &PackageStore,
dependencies: &Foo,
dependencies: &Dependencies,
ast_package: qsc_ast::ast::Package,
sources: SourceMap,
package_type: PackageType,
Expand Down
1 change: 1 addition & 0 deletions library/fixed_point/qsharp.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"src/Polynomial.qs",
"src/Reciprocal.qs",
"src/Signed.qs",
"src/Tests.qs",
"src/Types.qs"
]
}
2 changes: 1 addition & 1 deletion library/fixed_point/src/Facts.qs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import Types.FixedPoint;
/// # Description
/// This assertion succeeds when all qubits are in state $\ket{0}$,
/// representing that the register encodes the fixed-point number $0.0$.
operation AssertAllZeroFxP(fp : FixedPoint) : Unit is Adj + Ctl {
operation AssertAllZeroFxP(fp : FixedPoint) : Unit {
Fact(CheckAllZero(fp::Register), "Quantum fixed-point number was not zero.");
}

Expand Down
4 changes: 1 addition & 3 deletions library/fixed_point/src/Multiplication.qs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ operation MultiplyFxP(fp1 : FixedPoint, fp2 : FixedPoint, result : FixedPoint) :
}
controlled (controls, ...) {
IdenticalFormatFactFxP([fp1, fp2, result]);
AssertAllZeroFxP(result);
let n = Length(fp1::Register);

use tmpResult = Qubit[2 * n];
Expand All @@ -48,7 +47,7 @@ operation MultiplyFxP(fp1 : FixedPoint, fp2 : FixedPoint, result : FixedPoint) :
}
}

/// # Summary
/// # Summary
/// Squares a fixed-point number.
///
/// # Input
Expand All @@ -63,7 +62,6 @@ operation SquareFxP(fp : FixedPoint, result : FixedPoint) : Unit is Adj {
}
controlled (controls, ...) {
IdenticalFormatFactFxP([fp, result]);
AssertAllZeroFxP(result);
let n = Length(fp::Register);

use tmpResult = Qubit[2 * n];
Expand Down
1 change: 0 additions & 1 deletion library/fixed_point/src/Reciprocal.qs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ operation ComputeReciprocalFxP(x : FixedPoint, result : FixedPoint) : Unit is Ad
let (pRes, rs) = result!;
let n = Length(xs);

Fact(CheckAllZero(rs), "Output register must be zero at this point.");
Fact(p + pRes - 1 + n >= Length(rs), "Output register is too wide.");
use sign = Qubit();
use tmpRes = Qubit[2 * n];
Expand Down
Loading

0 comments on commit caa1d82

Please sign in to comment.