Structural, elastic and electronic properties of transition metal carbides TMC (TM=Ti, Zr, Hf and Ta) from first-principles calculations