This commit is contained in:
Takashi Kokubun 2020-05-01 00:45:17 -07:00
Родитель 5c8bfad078
Коммит 76507bfc3d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 6FFC433B12EE23DD
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -5,10 +5,15 @@ describe "Matrix.unitary?" do
it "returns false for non unitary matrices" do it "returns false for non unitary matrices" do
Matrix[[0, 1], [1, 2]].unitary?.should == false Matrix[[0, 1], [1, 2]].unitary?.should == false
Matrix[[0, Complex(0, 2)], [Complex(0, 2), 0]].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 Matrix[[1, 1, 0], [0, 1, 1], [1, 0, 1]].unitary?.should == false
end 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 it "returns true for unitary matrices" do
Matrix[[0, Complex(0, 1)], [Complex(0, 1), 0]].unitary?.should == true Matrix[[0, Complex(0, 1)], [Complex(0, 1), 0]].unitary?.should == true
end end