Skip to content

Commit 783eebe

Browse files
committed
Update test
1 parent 64a2311 commit 783eebe

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

quantum/density/matrix_test.go

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"github.com/itsubaki/q/quantum/qubit"
1212
)
1313

14-
func ExampleMatrix_bell() {
14+
func Example_bell() {
1515
rho, err := density.NewPureState(qubit.Zero(2).Apply(
1616
gate.H().TensorProduct(gate.I()),
1717
gate.CNOT(2, 0, 1),
@@ -233,11 +233,6 @@ func ExampleMatrix_PartialTrace() {
233233
panic(err)
234234
}
235235

236-
for _, r := range rho.Seq2() {
237-
fmt.Println(r)
238-
}
239-
fmt.Println()
240-
241236
s1 := rho.PartialTrace(0) // trace out qubit 0
242237
s0 := rho.PartialTrace(1) // trace out qubit 1
243238

@@ -246,11 +241,6 @@ func ExampleMatrix_PartialTrace() {
246241
fmt.Printf("trace: %.2v, purity: %.2v\n", s0.Trace(), s0.Purity())
247242

248243
// Output:
249-
// [(0.5+0i) (0+0i) (0+0i) (0+0i)]
250-
// [(0+0i) (0+0i) (0+0i) (0+0i)]
251-
// [(0+0i) (0+0i) (0.5+0i) (0+0i)]
252-
// [(0+0i) (0+0i) (0+0i) (0+0i)]
253-
//
254244
// trace: 1, purity: 0.5
255245
// trace: 1, purity: 1
256246
// trace: 1, purity: 0.5

0 commit comments

Comments
 (0)