01: package JSci.maths.algebras;
02:
03: import JSci.maths.*;
04: import JSci.maths.vectors.ComplexVector;
05: import JSci.maths.groups.*;
06:
07: /**
08: * The HilbertSpace class encapsulates Hilbert spaces.
09: * @jsci.planetmath HilbertSpace
10: * @version 1.0
11: * @author Mark Hale
12: */
13: public class HilbertSpace extends Object implements BanachSpace {
14: private int dim;
15: private ComplexVector ZERO;
16:
17: /**
18: * Constructs a Hilbert space.
19: */
20: public HilbertSpace(int n) {
21: dim = n;
22: ZERO = new ComplexVector(dim);
23: }
24:
25: /**
26: * Returns a vector from the Hilbert space.
27: */
28: public VectorSpace.Member getVector(Complex array[]) {
29: return new ComplexVector(array);
30: }
31:
32: /**
33: * Returns the dimension.
34: */
35: public int dimension() {
36: return dim;
37: }
38:
39: /**
40: * Returns the zero vector.
41: */
42: public AbelianGroup.Member zero() {
43: return ZERO;
44: }
45:
46: /**
47: * Returns true if the vector is equal to zero.
48: */
49: public boolean isZero(AbelianGroup.Member v) {
50: return ZERO.equals(v);
51: }
52:
53: /**
54: * Returns true if one vector is the negative of the other.
55: */
56: public boolean isNegative(AbelianGroup.Member a,
57: AbelianGroup.Member b) {
58: return ZERO.equals(a.add(b));
59: }
60:
61: /**
62: * This interface defines a member of a Hilbert space.
63: */
64: public interface Member extends BanachSpace.Member {
65: /**
66: * The scalar product law.
67: * @param v a Hilbert space vector
68: */
69: Complex scalarProduct(Member v);
70: }
71: }
|