mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Fix matrix spec for 7d360efe92
This commit is contained in:
parent
5c8bfad078
commit
76507bfc3d
1 changed files with 6 additions and 1 deletions
|
@ -5,10 +5,15 @@ describe "Matrix.unitary?" do
|
|||
it "returns false for non unitary matrices" do
|
||||
Matrix[[0, 1], [1, 2]].unitary?.should == false
|
||||
Matrix[[0, Complex(0, 2)], [Complex(0, 2), 0]].unitary?.should == false
|
||||
Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].unitary?.should == false
|
||||
Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].unitary?.should == false
|
||||
end
|
||||
|
||||
ruby_version_is '2.8' do # matrix v0.3.0
|
||||
it "returns false for non unitary matrix" do
|
||||
Matrix[[0, Complex(0, 1)], [Complex(0, -1), 0]].unitary?.should == true
|
||||
end
|
||||
end
|
||||
|
||||
it "returns true for unitary matrices" do
|
||||
Matrix[[0, Complex(0, 1)], [Complex(0, 1), 0]].unitary?.should == true
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue